Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Make Android port compatible with older API versions again.

Fixes Bugzilla #1563.

Thanks to Philipp Wiesemann for the patch!
  • Loading branch information
icculus committed Aug 4, 2012
1 parent 5af791c commit 4e5fb6c0c8e07fdeb38cfba57390230f7dd682d0
Showing with 2 additions and 2 deletions.
  1. +2 −2 android-project/src/org/libsdl/app/SDLActivity.java
@@ -539,9 +539,9 @@ public boolean onTouch(View v, MotionEvent event) {
final int touchDevId = event.getDeviceId();
final int pointerCount = event.getPointerCount();
// touchId, pointerId, action, x, y, pressure
int actionPointerIndex = event.getActionIndex();
int actionPointerIndex = (event.getAction() & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent. ACTION_POINTER_ID_SHIFT; /* API 8: event.getActionIndex(); */
int pointerFingerId = event.getPointerId(actionPointerIndex);
int action = event.getActionMasked();
int action = (event.getAction() & MotionEvent.ACTION_MASK); /* API 8: event.getActionMasked(); */

float x = event.getX(actionPointerIndex);
float y = event.getY(actionPointerIndex);

0 comments on commit 4e5fb6c

Please sign in to comment.