How can I limit fling in Android gallery to just one item per fling?

Gunnar Lium picture Gunnar Lium · Nov 30, 2010 · Viewed 13.9k times · Source

I have a gallery with several full screen images. I want to limit the fling gesture to only advance one image at a time (like the HTC Gallery app). What's the right/easiest way to achieve this?

Answer

olen_garn picture olen_garn · Dec 14, 2010

Simply override the Gallery Widget's onFling() method and don't call the superclass onFling() method.

This will make the gallery advance one item per swipe.