Search code examples
androidandroid-recyclerviewonscrolllistener

RecyclerView Scroll one element at a time


I have a Recyclerview containing images, each image filling the view completely. I want the user to be able to scroll them one at a time, so it does not scroll more than one element, and it stops at the beginning of each element.

I tried adding a scroll listener, but I am unable to lock the scrolling.

Do you know how to achieve this behavior?


Solution

  • Don't use a RecyclerView. Use a ViewPager that has a vertical direction. http://developer.android.com/reference/android/support/v4/view/ViewPager.html