Skip to content

Commit 9f207a8

Browse files
Jean-Baptiste QueruAndroid Git Automerger
authored andcommitted
am aff9079: am 4280891: Merge "The bigger touch slop still has a problem"
* commit 'aff90790dff94eb9a4bed541eff4f106623afd09': The bigger touch slop still has a problem
2 parents 46074f4 + aff9079 commit 9f207a8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

core/java/android/view/GestureDetector.java

100644100755
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ public boolean onSingleTapConfirmed(MotionEvent e) {
193193
}
194194
}
195195

196-
// TODO: ViewConfiguration
197-
private int mBiggerTouchSlopSquare = 20 * 20;
196+
private int mBiggerTouchSlopSquare;
198197

199198
private int mTouchSlopSquare;
200199
private int mDoubleTapSlopSquare;
@@ -408,6 +407,14 @@ private void init(Context context, boolean ignoreMultitouch) {
408407
}
409408
mTouchSlopSquare = touchSlop * touchSlop;
410409
mDoubleTapSlopSquare = doubleTapSlop * doubleTapSlop;
410+
411+
// The biggerTouchSlop should be a little bit bigger than touchSlop
412+
// and mBiggerTouchSlopSquare should not be over mDoubleTapSlopSquare.
413+
int biggerTouchSlop = (int)(touchSlop * 1.25f);
414+
mBiggerTouchSlopSquare = biggerTouchSlop * biggerTouchSlop;
415+
if (mBiggerTouchSlopSquare > mDoubleTapSlopSquare) {
416+
mBiggerTouchSlopSquare = mDoubleTapSlopSquare;
417+
}
411418
}
412419

413420
/**

0 commit comments

Comments
 (0)