diff options
author | Jim Miller <jaggies@google.com> | 2012-05-17 19:47:55 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2012-05-17 19:48:43 -0700 |
commit | 161538985ee51e109f64af9a332d396bbffd7e2c (patch) | |
tree | bddeb4c2aea363c4264b1bdd72f82709e2c7c926 /packages | |
parent | f7a44e8168d96ad75738226570d41e48f8fd14e3 (diff) | |
download | frameworks_base-161538985ee51e109f64af9a332d396bbffd7e2c.zip frameworks_base-161538985ee51e109f64af9a332d396bbffd7e2c.tar.gz frameworks_base-161538985ee51e109f64af9a332d396bbffd7e2c.tar.bz2 |
Fix 6441282: confine search gesture region on tablet navbar
Depending on the device, this will be one of the id's in the navbar
view hierarchy used in the source. It will default to the navbar
view if one isn't found.
Change-Id: I388412d4f247f7d2d102768708237711d722de3d
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java | 14 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java | 18 |
2 files changed, 25 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java index 7edeaef..a90192e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java @@ -33,11 +33,7 @@ public class DelegateViewHelper { private float mTriggerThreshhold; public DelegateViewHelper(View sourceView) { - mSourceView = sourceView; - if (mSourceView != null) { - mTriggerThreshhold = mSourceView.getContext().getResources() - .getDimension(R.dimen.navbar_search_up_threshhold); - } + setSourceView(sourceView); } public void setDelegateView(View view) { @@ -92,4 +88,12 @@ public class DelegateViewHelper { } return false; } + + public void setSourceView(View view) { + mSourceView = view; + if (mSourceView != null) { + mTriggerThreshhold = mSourceView.getContext().getResources() + .getDimension(R.dimen.navbar_search_up_threshhold); + } + } }
\ No newline at end of file diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java index a6fc396..25fdf07 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.tablet; +import com.android.systemui.R; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.DelegateViewHelper; @@ -37,8 +38,7 @@ public class TabletStatusBarView extends FrameLayout { private DelegateViewHelper mDelegateHelper; public TabletStatusBarView(Context context) { - super(context); - mDelegateHelper = new DelegateViewHelper(this); + this(context, null); } public TabletStatusBarView(Context context, AttributeSet attrs) { @@ -55,6 +55,20 @@ public class TabletStatusBarView extends FrameLayout { } @Override + protected void onFinishInflate() { + super.onFinishInflate(); + // Find the view we wish to grab events from in order to detect search gesture. + // Depending on the device, this will be one of the id's listed below. + // If we don't find one, we'll use the view provided in the constructor above (this view). + View view = null; + if ((view = findViewById(R.id.navigationArea)) != null) { + mDelegateHelper.setSourceView(view); + } else if ((view = findViewById(R.id.nav_buttons)) != null) { + mDelegateHelper.setSourceView(view); + } + } + + @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { if (TabletStatusBar.DEBUG) { |