summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-02-22 09:10:42 -0800
committerandroid code review <noreply-gerritcodereview@google.com>2012-02-22 09:10:43 -0800
commit4280891dbc2cf60bdf51726e0aa9265ccb64ec88 (patch)
treeedd092410b2110a7224d9472cf123ea6906a413c
parentfc24982a44d2b2b678fe5aa212b2e709d10e6413 (diff)
parentdac640f40350608158896fa2613836600c1e2339 (diff)
downloadframeworks_base-4280891dbc2cf60bdf51726e0aa9265ccb64ec88.zip
frameworks_base-4280891dbc2cf60bdf51726e0aa9265ccb64ec88.tar.gz
frameworks_base-4280891dbc2cf60bdf51726e0aa9265ccb64ec88.tar.bz2
Merge "The bigger touch slop still has a problem"
-rwxr-xr-x[-rw-r--r--]core/java/android/view/GestureDetector.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/java/android/view/GestureDetector.java b/core/java/android/view/GestureDetector.java
index a496a9e..5c8b236 100644..100755
--- a/core/java/android/view/GestureDetector.java
+++ b/core/java/android/view/GestureDetector.java
@@ -193,8 +193,7 @@ public class GestureDetector {
}
}
- // TODO: ViewConfiguration
- private int mBiggerTouchSlopSquare = 20 * 20;
+ private int mBiggerTouchSlopSquare;
private int mTouchSlopSquare;
private int mDoubleTapSlopSquare;
@@ -408,6 +407,14 @@ public class GestureDetector {
}
mTouchSlopSquare = touchSlop * touchSlop;
mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
+
+ // The biggerTouchSlop should be a little bit bigger than touchSlop
+ // and mBiggerTouchSlopSquare should not be over mDoubleTapSlopSquare.
+ int biggerTouchSlop = (int)(touchSlop * 1.25f);
+ mBiggerTouchSlopSquare = biggerTouchSlop * biggerTouchSlop;
+ if (mBiggerTouchSlopSquare > mDoubleTapSlopSquare) {
+ mBiggerTouchSlopSquare = mDoubleTapSlopSquare;
+ }
}
/**