Merge "The bigger touch slop still has a problem"

This commit is contained in:
Jean-Baptiste Queru
2012-02-22 09:10:42 -08:00
committed by android code review

11
core/java/android/view/GestureDetector.java Normal file → Executable file
View File

@@ -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;
}
}
/**