diff options
Diffstat (limited to 'core/java/android/view/ViewConfiguration.java')
-rwxr-xr-x[-rw-r--r--] | core/java/android/view/ViewConfiguration.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index 739758c..2a74eb7 100644..100755 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -129,6 +129,12 @@ public class ViewConfiguration { private static final int TOUCH_SLOP = 16; /** + * Distance a touch can wander before we think the user is the first touch + * in a sequence of double tap + */ + private static final int LARGE_TOUCH_SLOP = 18; + + /** * Distance a touch can wander before we think the user is attempting a paged scroll * (in dips) */ @@ -183,6 +189,7 @@ public class ViewConfiguration { private final int mMaximumFlingVelocity; private final int mScrollbarSize; private final int mTouchSlop; + private final int mLargeTouchSlop; private final int mPagingTouchSlop; private final int mDoubleTapSlop; private final int mWindowTouchSlop; @@ -204,6 +211,7 @@ public class ViewConfiguration { mMaximumFlingVelocity = MAXIMUM_FLING_VELOCITY; mScrollbarSize = SCROLL_BAR_SIZE; mTouchSlop = TOUCH_SLOP; + mLargeTouchSlop = LARGE_TOUCH_SLOP; mPagingTouchSlop = PAGING_TOUCH_SLOP; mDoubleTapSlop = DOUBLE_TAP_SLOP; mWindowTouchSlop = WINDOW_TOUCH_SLOP; @@ -240,6 +248,7 @@ public class ViewConfiguration { mMaximumFlingVelocity = (int) (density * MAXIMUM_FLING_VELOCITY + 0.5f); mScrollbarSize = (int) (density * SCROLL_BAR_SIZE + 0.5f); mTouchSlop = (int) (sizeAndDensity * TOUCH_SLOP + 0.5f); + mLargeTouchSlop = (int) (sizeAndDensity * LARGE_TOUCH_SLOP + 0.5f); mPagingTouchSlop = (int) (sizeAndDensity * PAGING_TOUCH_SLOP + 0.5f); mDoubleTapSlop = (int) (sizeAndDensity * DOUBLE_TAP_SLOP + 0.5f); mWindowTouchSlop = (int) (sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f); @@ -416,6 +425,14 @@ public class ViewConfiguration { } /** + * @return Distance a touch can wander before we think the user is the first touch + * in a sequence of double tap + */ + public int getScaledLargeTouchSlop() { + return mLargeTouchSlop; + } + + /** * @return Distance a touch can wander before we think the user is scrolling a full page * in dips */ |