Loading core/java/android/view/GestureDetector.java +3 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.view; import android.content.Context; import android.os.Build; import android.os.Handler; import android.os.Message; Loading Loading @@ -202,6 +201,7 @@ public class GestureDetector { private static final int LONGPRESS_TIMEOUT = ViewConfiguration.getLongPressTimeout(); private static final int TAP_TIMEOUT = ViewConfiguration.getTapTimeout(); private static final int DOUBLE_TAP_TIMEOUT = ViewConfiguration.getDoubleTapTimeout(); private static final int DOUBLE_TAP_MIN_TIME = ViewConfiguration.getDoubleTapMinTime(); // constants for Message.what used by GestureHandler below private static final int SHOW_PRESS = 1; Loading Loading @@ -673,7 +673,8 @@ public class GestureDetector { return false; } if (secondDown.getEventTime() - firstUp.getEventTime() > DOUBLE_TAP_TIMEOUT) { final long deltaTime = secondDown.getEventTime() - firstUp.getEventTime(); if (deltaTime > DOUBLE_TAP_TIMEOUT || deltaTime < DOUBLE_TAP_MIN_TIME) { return false; } Loading core/java/android/view/ViewConfiguration.java +18 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,13 @@ public class ViewConfiguration { */ private static final int DOUBLE_TAP_TIMEOUT = 300; /** * Defines the minimum duration in milliseconds between the first tap's up event and * the second tap's down event for an interaction to be considered a * double-tap. */ private static final int DOUBLE_TAP_MIN_TIME = 40; /** * Defines the maximum duration in milliseconds between a touch pad * touch and release for a given touch to be considered a tap (click) as Loading Loading @@ -435,6 +442,17 @@ public class ViewConfiguration { return DOUBLE_TAP_TIMEOUT; } /** * @return the minimum duration in milliseconds between the first tap's * up event and the second tap's down event for an interaction to be considered a * double-tap. * * @hide */ public static int getDoubleTapMinTime() { return DOUBLE_TAP_MIN_TIME; } /** * @return the maximum duration in milliseconds between a touch pad * touch and release for a given touch to be considered a tap (click) as Loading Loading
core/java/android/view/GestureDetector.java +3 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.view; import android.content.Context; import android.os.Build; import android.os.Handler; import android.os.Message; Loading Loading @@ -202,6 +201,7 @@ public class GestureDetector { private static final int LONGPRESS_TIMEOUT = ViewConfiguration.getLongPressTimeout(); private static final int TAP_TIMEOUT = ViewConfiguration.getTapTimeout(); private static final int DOUBLE_TAP_TIMEOUT = ViewConfiguration.getDoubleTapTimeout(); private static final int DOUBLE_TAP_MIN_TIME = ViewConfiguration.getDoubleTapMinTime(); // constants for Message.what used by GestureHandler below private static final int SHOW_PRESS = 1; Loading Loading @@ -673,7 +673,8 @@ public class GestureDetector { return false; } if (secondDown.getEventTime() - firstUp.getEventTime() > DOUBLE_TAP_TIMEOUT) { final long deltaTime = secondDown.getEventTime() - firstUp.getEventTime(); if (deltaTime > DOUBLE_TAP_TIMEOUT || deltaTime < DOUBLE_TAP_MIN_TIME) { return false; } Loading
core/java/android/view/ViewConfiguration.java +18 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,13 @@ public class ViewConfiguration { */ private static final int DOUBLE_TAP_TIMEOUT = 300; /** * Defines the minimum duration in milliseconds between the first tap's up event and * the second tap's down event for an interaction to be considered a * double-tap. */ private static final int DOUBLE_TAP_MIN_TIME = 40; /** * Defines the maximum duration in milliseconds between a touch pad * touch and release for a given touch to be considered a tap (click) as Loading Loading @@ -435,6 +442,17 @@ public class ViewConfiguration { return DOUBLE_TAP_TIMEOUT; } /** * @return the minimum duration in milliseconds between the first tap's * up event and the second tap's down event for an interaction to be considered a * double-tap. * * @hide */ public static int getDoubleTapMinTime() { return DOUBLE_TAP_MIN_TIME; } /** * @return the maximum duration in milliseconds between a touch pad * touch and release for a given touch to be considered a tap (click) as Loading