From: christoph.widulle Date: Thu, 30 Dec 2010 21:10:31 +0000 (+0000) Subject: [change] minor improvement X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=144a78e28f2c8e87db92d3f84dfb2ae27ddb97da;p=mikumikustudio%2Flibgdx-mikumikustudio.git [change] minor improvement --- diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidSingleTouchHandler.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidSingleTouchHandler.java index 57b697ccb..707ff6680 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidSingleTouchHandler.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidSingleTouchHandler.java @@ -29,21 +29,20 @@ public class AndroidSingleTouchHandler implements AndroidTouchHandler { int y = (int)event.getY(); input.touchX[0] = x; input.touchY[0] = y; + if (event.getAction() == MotionEvent.ACTION_DOWN) { postTouchEvent(input, TouchEvent.TOUCH_DOWN, x, y, 0); input.touched[0] = true; - } - if (event.getAction() == MotionEvent.ACTION_MOVE) { + }else if (event.getAction() == MotionEvent.ACTION_MOVE) { postTouchEvent(input, TouchEvent.TOUCH_DRAGGED, x, y, 0); input.touched[0] = true; - } - if (event.getAction() == MotionEvent.ACTION_UP) { + + }else if (event.getAction() == MotionEvent.ACTION_UP) { postTouchEvent(input, TouchEvent.TOUCH_UP, x, y, 0); input.touched[0] = false; - } - if (event.getAction() == MotionEvent.ACTION_CANCEL) { + }else if (event.getAction() == MotionEvent.ACTION_CANCEL) { postTouchEvent(input, TouchEvent.TOUCH_UP, x, y, 0); input.touched[0] = false; }