summaryrefslogtreecommitdiff
path: root/core/java/android/widget/ZoomButtonsController.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-02-15 19:18:31 -0800
committerJeff Brown <jeffbrown@google.com>2012-02-15 19:32:16 -0800
commita175a5b7ea3682cb58cca7f9726d0b8171cd549d (patch)
treea0747492e739adc22a9415fe37a19a71a4a1e010 /core/java/android/widget/ZoomButtonsController.java
parent1654d0b8d9ba477a0134338838b6e5921f1aabb8 (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/widget/ZoomButtonsController.java')
-rw-r--r--core/java/android/widget/ZoomButtonsController.java16
1 files changed, 1 insertions, 15 deletions
diff --git a/core/java/android/widget/ZoomButtonsController.java b/core/java/android/widget/ZoomButtonsController.java
index f3d891d11989..02dc27bef3e9 100644
--- a/core/java/android/widget/ZoomButtonsController.java
+++ b/core/java/android/widget/ZoomButtonsController.java
@@ -501,7 +501,7 @@ public class ZoomButtonsController implements View.OnTouchListener {
} else {
- ViewRootImpl viewRoot = getOwnerViewRootImpl();
+ ViewRootImpl viewRoot = mOwnerView.getViewRootImpl();
if (viewRoot != null) {
viewRoot.dispatchKey(event);
}
@@ -526,20 +526,6 @@ public class ZoomButtonsController implements View.OnTouchListener {
}
}
- private ViewRootImpl getOwnerViewRootImpl() {
- View rootViewOfOwner = mOwnerView.getRootView();
- if (rootViewOfOwner == null) {
- return null;
- }
-
- ViewParent parentOfRootView = rootViewOfOwner.getParent();
- if (parentOfRootView instanceof ViewRootImpl) {
- return (ViewRootImpl) parentOfRootView;
- } else {
- return null;
- }
- }
-
/**
* @hide The ZoomButtonsController implements the OnTouchListener, but this
* does not need to be shown in its public API.