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.
This commit is contained in:
Dianne Hackborn
2010-02-12 15:52:09 -08:00
parent d382e4bee9
commit b125dc5599
5 changed files with 149 additions and 55 deletions

View File

@@ -570,14 +570,14 @@ public class InputDevice {
mDownTime = curTime;
} else {
action = MotionEvent.ACTION_POINTER_DOWN
| (upOrDownPointer << MotionEvent.ACTION_POINTER_ID_SHIFT);
| (upOrDownPointer << MotionEvent.ACTION_POINTER_INDEX_SHIFT);
}
} else {
if (numPointers == 1) {
action = MotionEvent.ACTION_UP;
} else {
action = MotionEvent.ACTION_POINTER_UP
| (upOrDownPointer << MotionEvent.ACTION_POINTER_ID_SHIFT);
| (upOrDownPointer << MotionEvent.ACTION_POINTER_INDEX_SHIFT);
}
}
currentMove = null;