I have a LinearLayout inside a HorizontalScrollView. The content is just a image. While scrolling, I need to achieve the same behavior you get when setting the paging option on a the iPhone equivalent of the HSW (scrolling the list should stop at every page on the list, not continue moving).
How is this done in Android? Should I implement this features by myself or there is a particular property to set or a subclass of HSV to implement?
I came across a nice solution here:
this is a cleaned up GitHub version of the code found here:
It may seem like overkill for just using it on images, but this solution allows for infinite paging with using a little trick (ie: when on first page you can scroll back to last page and when on last page you can scroll forward to first page). It also allows you to have an unknown number of pages and dynamically generate content by using another little trick. Please see my comment in the second link here
for details on how i accomplished this.
Hope this helps.