sunil jain sunil jain - 6 months ago 49
Android Question

SimpleOnGestureListener.OnScroll doesn't calling properly on fast scrolling

I need to change an image when the user swipes from left to right; that's why I have used

to detect a swipe event on an

In this process, when I swipe an image slowly, the
method calls frequently and every thing is working fine but when I swipe this image fastly, the
method called hardly only two three times, please let me know what should I use to make the
method called according swipe's speed.

I am a new bee to Android, so your help will be appreciated.



I can think of other ways of achieving what you want

onFling() gives you the velocity of X and Y: if it's greater than 4000 it counts as a fast scroll, then you can animate the continuous image, its effect like fast swiping.