summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2014-11-05 13:41:12 -0800
committerThe Android Automerger <android-build@google.com>2014-11-07 13:38:18 -0800
commitc482a9d86ea22c002fff1b5435a61ccba2149008 (patch)
treeeeb044e7d4c867e3feecaa213b640229a3e75c30
parent5a150e4426d1967276bc11c708c4c3d9be7c6a68 (diff)
downloadbase-linaro-fvp-lollipop.tar.gz
Increasing the min swipe thresholds for the nav bar gestures. (Bug 17109581)android-5.0.0_r6android-5.0.0_r5.1android-5.0.0_r5linaro-fvp-lollipop
Change-Id: I1bcf6f91f616890f0e815db33267c5230ae9c76f (cherry picked from commit 559e6d34b4e76ee21dc6e300681c399ed735a964)
-rw-r--r--packages/SystemUI/res/values/dimens.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java5
3 files changed, 10 insertions, 4 deletions
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 4f41cd560ae4..fabdf2979f01 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -63,6 +63,8 @@
<!-- thickness (height) of the navigation bar on phones that require it -->
<dimen name="navigation_bar_size">@*android:dimen/navigation_bar_height</dimen>
+ <!-- Minimum swipe distance to catch the swipe gestures to invoke assist or switch tasks. -->
+ <dimen name="navigation_bar_min_swipe_distance">48dp</dimen>
<!-- thickness (height) of the dead zone at the top of the navigation bar,
reducing false presses on navbar buttons; approx 2mm -->
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
index 628aab86840c..7ae6764ae679 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java
@@ -17,10 +17,11 @@
package com.android.systemui.statusbar;
import android.app.StatusBarManager;
+import android.content.res.Resources;
import android.graphics.RectF;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewConfiguration;
+import com.android.systemui.R;
public class DelegateViewHelper {
private View mDelegateView;
@@ -106,8 +107,8 @@ public class DelegateViewHelper {
public void setSourceView(View view) {
mSourceView = view;
if (mSourceView != null) {
- mTriggerThreshhold =
- ViewConfiguration.get(mSourceView.getContext()).getScaledPagingTouchSlop();
+ Resources r = mSourceView.getContext().getResources();
+ mTriggerThreshhold = r.getDimensionPixelSize(R.dimen.navigation_bar_min_swipe_distance);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java
index c253e19fe57f..fdfcdfbda4af 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java
@@ -17,9 +17,11 @@
package com.android.systemui.statusbar.phone;
import android.content.Context;
+import android.content.res.Resources;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
+import com.android.systemui.R;
import com.android.systemui.statusbar.BaseStatusBar;
public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnGestureListener {
@@ -36,7 +38,8 @@ public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnG
public NavigationBarViewTaskSwitchHelper(Context context) {
ViewConfiguration configuration = ViewConfiguration.get(context);
- mScrollTouchSlop = 4 * configuration.getScaledTouchSlop();
+ Resources r = context.getResources();
+ mScrollTouchSlop = r.getDimensionPixelSize(R.dimen.navigation_bar_min_swipe_distance);
mMinFlingVelocity = configuration.getScaledMinimumFlingVelocity();
mTaskSwitcherDetector = new GestureDetector(context, this);
}