|
@@ -22,8 +22,8 @@ public class OnSwipeTouchListener implements OnTouchListener {
|
|
|
|
|
|
private final class GestureListener extends SimpleOnGestureListener {
|
|
|
|
|
|
- private static final int SWIPE_THRESHOLD = 250;
|
|
|
- private static final int SWIPE_VELOCITY_THRESHOLD = 70; //or 60
|
|
|
+ private static final int SWIPE_THRESHOLD = 100;
|
|
|
+ private static final int SWIPE_VELOCITY_THRESHOLD = 100; //or 60
|
|
|
|
|
|
@Override
|
|
|
public boolean onDown(MotionEvent e) {
|
|
@@ -40,16 +40,20 @@ public class OnSwipeTouchListener implements OnTouchListener {
|
|
|
if (Math.abs(diffX) > SWIPE_THRESHOLD && Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) {
|
|
|
if (diffX > 0) {
|
|
|
onSwipeRight();
|
|
|
+ result = true;
|
|
|
} else {
|
|
|
onSwipeLeft();
|
|
|
+ result = true;
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
if (Math.abs(diffY) > SWIPE_THRESHOLD && Math.abs(velocityY) > SWIPE_VELOCITY_THRESHOLD) {
|
|
|
if (diffY > 0) {
|
|
|
onSwipeBottom();
|
|
|
+ result = true;
|
|
|
} else {
|
|
|
onSwipeTop();
|
|
|
+ result = true;
|
|
|
}
|
|
|
}
|
|
|
}
|