summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewConfiguration.java
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2013-09-05 13:44:45 -0700
committerAdam Powell <adamp@google.com>2013-09-05 13:44:45 -0700
commitaf1785f0b54bff4fcc6218619e34b9861e129cb9 (patch)
treee7a05a76cfa2b7a8467b4d1a43dd33d87d2c4f2f /core/java/android/view/ViewConfiguration.java
parent49ee555f239c79871b661e5ff135061f26665e1c (diff)
Add a minimum timeout for double-tap in GestureDetector
Prevent noisy falsing. Minimum timeout is currently 40ms and can be tuned for later. Consider un-hiding the ViewConfiguration query method later. Bug 10476944 Change-Id: Ib470735ec929b0b358fca4597e92dc81084e675f
Diffstat (limited to 'core/java/android/view/ViewConfiguration.java')
-rw-r--r--core/java/android/view/ViewConfiguration.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index f8cb9c068aa7..c3f064fdfd4a 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -97,6 +97,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
* opposed to a hover movement gesture.
@@ -436,6 +443,17 @@ public class ViewConfiguration {
}
/**
+ * @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
* opposed to a hover movement gesture.