sunil jain sunil jain - 1 year ago 94
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.


Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download