bug 723243 - SimpleScaleGestureDetector uses getActionIndex(), which is not available in eclair r=wesj

This commit is contained in:
Brad Lassey 2012-02-01 15:03:46 -05:00
parent a22d53f424
commit cb4401d7dd

View File

@ -101,9 +101,14 @@ public class SimpleScaleGestureDetector {
return mPointerInfo.size();
}
private int getActionIndex(MotionEvent event) {
return (event.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK)
>> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
}
private void onTouchStart(MotionEvent event) {
mLastEventTime = event.getEventTime();
mPointerInfo.addFirst(PointerInfo.create(event, event.getActionIndex()));
mPointerInfo.addFirst(PointerInfo.create(event, getActionIndex(event)));
if (getPointersDown() == 2) {
sendScaleGesture(EventType.BEGIN);
}
@ -126,7 +131,7 @@ public class SimpleScaleGestureDetector {
private void onTouchEnd(MotionEvent event) {
mLastEventTime = event.getEventTime();
int id = event.getPointerId(event.getActionIndex());
int id = event.getPointerId(getActionIndex(event));
ListIterator<PointerInfo> iterator = mPointerInfo.listIterator();
while (iterator.hasNext()) {
PointerInfo pointerInfo = iterator.next();