summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/ViewConfiguration.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@android.com>2011-06-06 20:30:47 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-06 20:30:47 -0700
commited48fa89a8e31b04681347a9235c2a566e7dbb8e (patch)
tree7f263849b561d892ddbf422a5ffeca34d0f7bff0 /core/java/android/view/ViewConfiguration.java
parentc1830a77a7fe0f1ccd52f405cb076d40fe085e2f (diff)
parentbb3fcba0caf697f1d238a2cbefdf1efe06eded99 (diff)
downloadframeworks_base-ed48fa89a8e31b04681347a9235c2a566e7dbb8e.zip
frameworks_base-ed48fa89a8e31b04681347a9235c2a566e7dbb8e.tar.gz
frameworks_base-ed48fa89a8e31b04681347a9235c2a566e7dbb8e.tar.bz2
Merge "Touch pad improvements. Bug: 4124987" into honeycomb-mr2
Diffstat (limited to 'core/java/android/view/ViewConfiguration.java')
-rw-r--r--core/java/android/view/ViewConfiguration.java40
1 files changed, 37 insertions, 3 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 739758c..392797c 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -111,7 +111,21 @@ public class ViewConfiguration {
* double-tap.
*/
private static final int DOUBLE_TAP_TIMEOUT = 300;
-
+
+ /**
+ * 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.
+ */
+ private static final int HOVER_TAP_TIMEOUT = 150;
+
+ /**
+ * Defines the maximum distance in pixels that a touch pad touch can move
+ * before being released for it to be considered a tap (click) as opposed
+ * to a hover movement gesture.
+ */
+ private static final int HOVER_TAP_SLOP = 20;
+
/**
* Defines the duration in milliseconds we want to display zoom controls in response
* to a user panning within an application.
@@ -360,7 +374,7 @@ public class ViewConfiguration {
public static int getTapTimeout() {
return TAP_TIMEOUT;
}
-
+
/**
* @return the duration in milliseconds we will wait to see if a touch event
* is a jump tap. If the user does not move within this interval, it is
@@ -378,7 +392,27 @@ public class ViewConfiguration {
public static int getDoubleTapTimeout() {
return DOUBLE_TAP_TIMEOUT;
}
-
+
+ /**
+ * @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.
+ * @hide
+ */
+ public static int getHoverTapTimeout() {
+ return HOVER_TAP_TIMEOUT;
+ }
+
+ /**
+ * @return the maximum distance in pixels that a touch pad touch can move
+ * before being released for it to be considered a tap (click) as opposed
+ * to a hover movement gesture.
+ * @hide
+ */
+ public static int getHoverTapSlop() {
+ return HOVER_TAP_SLOP;
+ }
+
/**
* @return Inset in pixels to look for touchable content when the user touches the edge of the
* screen