summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/GestureDetector.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-02-12 15:52:09 -0800
committerDianne Hackborn <hackbod@google.com>2010-02-12 17:52:22 -0800
commitb125dc5599468a09d82751cd76152071ae485afb (patch)
tree6d7ea46208c30bf1ae9014b70d7f5f50167eaa10 /core/java/android/view/GestureDetector.java
parentd382e4bee9c6cf96f97700ebcffcf81465294146 (diff)
downloadframeworks_base-b125dc5599468a09d82751cd76152071ae485afb.zip
frameworks_base-b125dc5599468a09d82751cd76152071ae485afb.tar.gz
frameworks_base-b125dc5599468a09d82751cd76152071ae485afb.tar.bz2
Fix MotionEvent pointer API.
Ooops. The API said that the pointer down and up actions contained the pointer id, but it is actually the index. Actually it makes much more sense for it to be the index, and those ACTION_POINTER_1_DOWN etc. constants were stupid.
Diffstat (limited to 'core/java/android/view/GestureDetector.java')
-rw-r--r--core/java/android/view/GestureDetector.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/view/GestureDetector.java b/core/java/android/view/GestureDetector.java
index 3c79200..58f998e 100644
--- a/core/java/android/view/GestureDetector.java
+++ b/core/java/android/view/GestureDetector.java
@@ -465,10 +465,10 @@ public class GestureDetector {
case MotionEvent.ACTION_POINTER_UP:
// Ending a multitouch gesture and going back to 1 finger
if (mIgnoreMultitouch && ev.getPointerCount() == 2) {
- int id = (((action & MotionEvent.ACTION_POINTER_ID_MASK)
- >> MotionEvent.ACTION_POINTER_ID_SHIFT) == 0) ? 1 : 0;
- mLastMotionX = ev.getX(id);
- mLastMotionY = ev.getY(id);
+ int index = (((action & MotionEvent.ACTION_POINTER_INDEX_MASK)
+ >> MotionEvent.ACTION_POINTER_INDEX_SHIFT) == 0) ? 1 : 0;
+ mLastMotionX = ev.getX(index);
+ mLastMotionY = ev.getY(index);
mVelocityTracker.recycle();
mVelocityTracker = VelocityTracker.obtain();
}