From 9152ed42e047502911e9c0dfe2b70fa1020d6e75 Mon Sep 17 00:00:00 2001 From: Daniel Lew Date: Tue, 19 Nov 2013 10:58:15 -0600 Subject: [PATCH] Some sprucing up of output/code --- .../main/java/com/idunnolol/findviewbyid/MainActivity.java | 7 +++++-- FindViewById/src/main/res/layout/activity_main.xml | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/FindViewById/src/main/java/com/idunnolol/findviewbyid/MainActivity.java b/FindViewById/src/main/java/com/idunnolol/findviewbyid/MainActivity.java index 89cae7c..98cb10c 100644 --- a/FindViewById/src/main/java/com/idunnolol/findviewbyid/MainActivity.java +++ b/FindViewById/src/main/java/com/idunnolol/findviewbyid/MainActivity.java @@ -86,7 +86,7 @@ public void onClick(View v) { } private void updateStatus() { - mStatusTextView.setText("Depth=" + mDepth + " Views (per node)=" + mNumChildrenPerNode + " total=" + getViewCount() + " testIterations=" + getRunTimes()); + mStatusTextView.setText("depth=" + mDepth + " viewsPerNode=" + mNumChildrenPerNode + " totalViews=" + getViewCount() + " testIterations=" + getRunTimes()); } // Modulate based on number of nodes, so we don't ever quite overload the system @@ -154,7 +154,10 @@ public void run() { long total = 0; for (int a = 0; a < numTimes; a++) { start = System.nanoTime(); - mContainer.findViewById(mId); // Find past the FURTHEST id + + // Find past the FURTHEST id, so it has to scan all the nodes and then fails + mContainer.findViewById(mId); + end = System.nanoTime(); total += end - start; } diff --git a/FindViewById/src/main/res/layout/activity_main.xml b/FindViewById/src/main/res/layout/activity_main.xml index 117aadb..d2f2241 100644 --- a/FindViewById/src/main/res/layout/activity_main.xml +++ b/FindViewById/src/main/res/layout/activity_main.xml @@ -4,6 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" + android:padding="8dp" tools:context=".MainActivity" tools:ignore="MergeRootFrame">