I use the Gesture Listner to navigate the Swipe screen. But it is not so convenient that I need to scroll several times to go to the next or previous screen. What are the correct values โโfor Velocity, Off path and Min Distance.
Below is my code:
private static final int SWIPE_MIN_DISTANCE = 50; private static final int SWIPE_MAX_OFF_PATH = 300; private static final int SWIPE_THRESHOLD_VELOCITY = 200; class MyGestureDetector extends SimpleOnGestureListener { @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { try { if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) return false;
source share