diff options
| author | Jeff Brown <jeffbrown@google.com> | 2012-02-15 19:18:31 -0800 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2012-02-15 19:32:16 -0800 |
| commit | a175a5b7ea3682cb58cca7f9726d0b8171cd549d (patch) | |
| tree | a0747492e739adc22a9415fe37a19a71a4a1e010 /core/java/android/view/ViewDebug.java | |
| parent | 1654d0b8d9ba477a0134338838b6e5921f1aabb8 (diff) | |
Encapsulate the ViewRootImpl's handler.
This change makes it much easier to make sense of the messages that
get posted to the ViewRootImpl's handler by encapsulating their point
of dispatch within the ViewRootImpl itself.
As part of this change, the View.AttachInfo now carries a reference
to the ViewRootImpl itself, which simplifies some code that used
to try to find the ViewRootImpl by getting the root view's parent.
In principle, it might have been nice to hide the ViewRootImpl from
the View hierarchy but in practice the two were coupled in many ways.
Change-Id: I51ebccdf5f8c8c505cd6f17cdf594174d041dc54
Diffstat (limited to 'core/java/android/view/ViewDebug.java')
| -rw-r--r-- | core/java/android/view/ViewDebug.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/view/ViewDebug.java b/core/java/android/view/ViewDebug.java index c1db5720e2f1..2a178451df9e 100644 --- a/core/java/android/view/ViewDebug.java +++ b/core/java/android/view/ViewDebug.java @@ -375,7 +375,7 @@ public class ViewDebug { } private static BufferedWriter sHierarchyTraces; - private static ViewRootImpl sHierarhcyRoot; + private static ViewRootImpl sHierarchyRoot; private static String sHierarchyTracePrefix; /** @@ -855,7 +855,7 @@ public class ViewDebug { return; } - if (sHierarhcyRoot != null) { + if (sHierarchyRoot != null) { throw new IllegalStateException("You must call stopHierarchyTracing() before running" + " a new trace!"); } @@ -874,7 +874,7 @@ public class ViewDebug { return; } - sHierarhcyRoot = (ViewRootImpl) view.getRootView().getParent(); + sHierarchyRoot = view.getViewRootImpl(); } /** @@ -896,7 +896,7 @@ public class ViewDebug { return; } - if (sHierarhcyRoot == null || sHierarchyTraces == null) { + if (sHierarchyRoot == null || sHierarchyTraces == null) { throw new IllegalStateException("You must call startHierarchyTracing() before" + " stopHierarchyTracing()!"); } @@ -921,7 +921,7 @@ public class ViewDebug { return; } - View view = sHierarhcyRoot.getView(); + View view = sHierarchyRoot.getView(); if (view instanceof ViewGroup) { ViewGroup group = (ViewGroup) view; dumpViewHierarchy(group, out, 0); @@ -932,7 +932,7 @@ public class ViewDebug { } } - sHierarhcyRoot = null; + sHierarchyRoot = null; } static void dispatchCommand(View view, String command, String parameters, |
