summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/ExpandHelper.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/ExpandHelper.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
index e2b12daf441e..59af458e2402 100644
--- a/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/ExpandHelper.java
@@ -86,7 +86,8 @@ public class ExpandHelper implements Gefingerpoken {
private float mInitialTouchSpan;
private float mLastFocusY;
private float mLastSpanY;
- private int mTouchSlop;
+ private final int mTouchSlop;
+ private final float mSlopMultiplier;
private float mLastMotionY;
private float mPullGestureMinXSpan;
private Callback mCallback;
@@ -177,6 +178,7 @@ public class ExpandHelper implements Gefingerpoken {
final ViewConfiguration configuration = ViewConfiguration.get(mContext);
mTouchSlop = configuration.getScaledTouchSlop();
+ mSlopMultiplier = configuration.getAmbiguousGestureMultiplier();
mSGD = new ScaleGestureDetector(context, mScaleGestureListener);
mFlingAnimationUtils = new FlingAnimationUtils(mContext.getResources().getDisplayMetrics(),
@@ -258,6 +260,13 @@ public class ExpandHelper implements Gefingerpoken {
mScrollAdapter = adapter;
}
+ private float getTouchSlop(MotionEvent event) {
+ // Adjust the touch slop if another gesture may be being performed.
+ return event.getClassification() == MotionEvent.CLASSIFICATION_AMBIGUOUS_GESTURE
+ ? mTouchSlop * mSlopMultiplier
+ : mTouchSlop;
+ }
+
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (!isEnabled()) {
@@ -303,7 +312,7 @@ public class ExpandHelper implements Gefingerpoken {
if (mWatchingForPull) {
final float yDiff = ev.getRawY() - mInitialTouchY;
final float xDiff = ev.getRawX() - mInitialTouchX;
- if (yDiff > mTouchSlop && yDiff > Math.abs(xDiff)) {
+ if (yDiff > getTouchSlop(ev) && yDiff > Math.abs(xDiff)) {
if (DEBUG) Log.v(TAG, "got venetian gesture (dy=" + yDiff + "px)");
mWatchingForPull = false;
if (mResizedView != null && !isFullyExpanded(mResizedView)) {
@@ -431,7 +440,7 @@ public class ExpandHelper implements Gefingerpoken {
if (mWatchingForPull) {
final float yDiff = ev.getRawY() - mInitialTouchY;
final float xDiff = ev.getRawX() - mInitialTouchX;
- if (yDiff > mTouchSlop && yDiff > Math.abs(xDiff)) {
+ if (yDiff > getTouchSlop(ev) && yDiff > Math.abs(xDiff)) {
if (DEBUG) Log.v(TAG, "got venetian gesture (dy=" + yDiff + "px)");
mWatchingForPull = false;
if (mResizedView != null && !isFullyExpanded(mResizedView)) {