Make Android port compatible with older API versions again.
authorRyan C. Gordon
Fri, 03 Aug 2012 23:59:05 -0400
changeset 63860aa624a37ad4
parent 6385 f909e1dab4e2
child 6387 58f0fb54bf88
Make Android port compatible with older API versions again.

Fixes Bugzilla #1563.

Thanks to Philipp Wiesemann for the patch!
android-project/src/org/libsdl/app/SDLActivity.java
     1.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Wed Aug 01 21:41:54 2012 -0400
     1.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Fri Aug 03 23:59:05 2012 -0400
     1.3 @@ -539,9 +539,9 @@
     1.4               final int touchDevId = event.getDeviceId();
     1.5               final int pointerCount = event.getPointerCount();
     1.6               // touchId, pointerId, action, x, y, pressure
     1.7 -             int actionPointerIndex = event.getActionIndex();
     1.8 +             int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent. ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */
     1.9               int pointerFingerId = event.getPointerId(actionPointerIndex);
    1.10 -             int action = event.getActionMasked();
    1.11 +             int action = (event.getAction() & MotionEvent.ACTION_MASK); /* API 8: event.getActionMasked(); */
    1.12  
    1.13               float x = event.getX(actionPointerIndex);
    1.14               float y = event.getY(actionPointerIndex);