how to make a gallery control to scroll one image at a time? Also what is a good way of making a continuous loop of those images? I tried overriding onFling, does not work a
Aniket Awati's solution worked best for me. However I would suggest an improvement to avoid two items beings scrolled in certain cases.
int mSelection = 0;
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
boolean leftScroll = isScrollingLeft(e1, e2);
boolean rightScroll = isScrollingRight(e1, e2);
if (rightScroll) {
if (mSelection != 0)
setSelection(--mSelection, true);
} else if (leftScroll) {
if (mSelection != getCount() - 1)
setSelection(++mSelection, true);
}
return false;
}