4

I have a horizontal RecyclerView that shows 4 cards numbered 1-4. These cards take up the entire width of the screen so only 1 card can be fully visible at a time. The user is presented with the first card, when they swipe the card to the left like this,

enter image description here

the RecyclerView will scroll all the way to number 4. I don't want that.

I want the swipe to bring the next card (number 2) into the view

Similar to how Androids ViewPager works.

Gary Holiday
  • 3,297
  • 3
  • 31
  • 72

1 Answers1

16
SnapHelper snapHelper = new PagerSnapHelper();
snapHelper.attachToRecyclerView(recyclerView);

Added in android.support library

Rafi Panoyan
  • 822
  • 9
  • 21