Question

I am using a Gallery based Cover-flow, as suggested here.
Is there an event that can be caught, which indicates that a single shift (either left or right) has been made in my gallery/cover-flow?
To be clear, if I gave the gallery a decent swipe and my center (selected) image has changed 8 times, I would like to catch this event 8 times.

OnFling() just indicates a single swipe - regardless how many items have shifted.
Getting getSelectedItemPosition() before and after the swipe doesn't help since I need to do some work on every shift.
It will also be nice while I am at it, to get the direction of the shift - either right or left.

Was it helpful?

Solution

If I understand you correctly you should implement this interface and set it to you Gallery with setOnItemSelectedListener method, also setCallbackDuringFlingmight be usefull.
To get fling direction you can save last selected position and compare it with new one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top