diff options
author | Romain Guy <romainguy@android.com> | 2009-05-21 23:10:10 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2009-05-22 01:59:59 -0700 |
commit | d6a463a9f23b3901bf729f2f27a6bb8f78b95248 (patch) | |
tree | 1371cafd6a1c0fe8d3cd4580e7878a9adb86b183 /core/java/android/gesture/GestureStroke.java | |
parent | cfcc0df2658d0ce7dc753511bb44ab8ae7a636f7 (diff) | |
download | frameworks_base-d6a463a9f23b3901bf729f2f27a6bb8f78b95248.zip frameworks_base-d6a463a9f23b3901bf729f2f27a6bb8f78b95248.tar.gz frameworks_base-d6a463a9f23b3901bf729f2f27a6bb8f78b95248.tar.bz2 |
Add a new API to ListView: setGestures(int). This allows developers to enable gestures to jump inside the list or filter it. This change also introduces a new XML attribute to control this API. It also adds the ability to theme the GestureOverlayView from the gestures library. Finally, this adds a new VERSION header to the binary format used to store the letters for the recognizer.
Diffstat (limited to 'core/java/android/gesture/GestureStroke.java')
-rw-r--r-- | core/java/android/gesture/GestureStroke.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/gesture/GestureStroke.java b/core/java/android/gesture/GestureStroke.java index 5160a76..6d022b4 100644 --- a/core/java/android/gesture/GestureStroke.java +++ b/core/java/android/gesture/GestureStroke.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2009 The Android Open Source Project + * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,8 @@ import java.util.ArrayList; * A gesture stroke started on a touch down and ended on a touch up. */ public class GestureStroke { + static final float TOUCH_TOLERANCE = 3; + public final RectF boundingBox; public final float length; @@ -156,8 +158,8 @@ public class GestureStroke { } else { float dx = Math.abs(x - mX); float dy = Math.abs(y - mY); - if (dx >= GestureOverlayView.TOUCH_TOLERANCE || - dy >= GestureOverlayView.TOUCH_TOLERANCE) { + if (dx >= TOUCH_TOLERANCE || + dy >= TOUCH_TOLERANCE) { path.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2); mX = x; mY = y; |