|
|
@@ -15,10 +15,10 @@ import android.view.MotionEvent;
|
|
|
public class TouchEventWithDirection {
|
|
|
|
|
|
public static final String DIRECTION_NONE = "none";
|
|
|
- public static final String DIRECTION_UP = "up";
|
|
|
public static final String DIRECTION_DOWN = "down";
|
|
|
- public static final String DIRECTION_RIGHT = "right";
|
|
|
+ public static final String DIRECTION_UP = "up";
|
|
|
public static final String DIRECTION_LEFT = "left";
|
|
|
+ public static final String DIRECTION_RIGHT = "right";
|
|
|
|
|
|
private String direction;
|
|
|
private int oldX;
|
|
|
@@ -49,10 +49,10 @@ public class TouchEventWithDirection {
|
|
|
if (Math.abs(dx) > Math.abs(dy)) {
|
|
|
if (Math.abs(dx) > distanceMinPx) {
|
|
|
if (dx > 0) {
|
|
|
- direction = DIRECTION_RIGHT;
|
|
|
+ direction = DIRECTION_LEFT;
|
|
|
}
|
|
|
else {
|
|
|
- direction = DIRECTION_LEFT;
|
|
|
+ direction = DIRECTION_RIGHT;
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
@@ -62,10 +62,10 @@ public class TouchEventWithDirection {
|
|
|
else {
|
|
|
if (Math.abs(dy) > distanceMinPx) {
|
|
|
if (dy > 0) {
|
|
|
- direction = DIRECTION_DOWN;
|
|
|
+ direction = DIRECTION_UP;
|
|
|
}
|
|
|
else {
|
|
|
- direction = DIRECTION_UP;
|
|
|
+ direction = DIRECTION_DOWN;
|
|
|
}
|
|
|
}
|
|
|
else {
|