Skip to content Skip to sidebar Skip to footer

Remove Swipe Effect In Gallery From Top To Bottom In Android

I have developed a custom gallery and override the on-fling method in it to swipe one image at a time.It worked, but the problem is when i swipe from top to bottom or vice-versa th

Solution 1:

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
        float velocityY) {
    if (Math.abs(velocityX) > Math.abs(velocityY))
    {
        // This is an horizontal fling
        // Do your operation here
    }     
    else
        // This is an vertical fling
 }

Post a Comment for "Remove Swipe Effect In Gallery From Top To Bottom In Android"