rubensousa / GravitySnapHelper

A SnapHelper that snaps a RecyclerView to an edge.
Apache License 2.0
5k stars 615 forks source link

Scroll like viewpager #9

Closed jianyaoang closed 8 years ago

jianyaoang commented 8 years ago

First of all, absolutely like this! It was really easy to use, and the results achieved is amazing.

I have a question, and not sure how do I go about if I implement this with my RecyclerView. Basically, my RecyclerView is showing 4 rows per screen. Using RecyclerViewSnap, how do I go about scrolling my RecyclerView like a ViewPager? I like how RecyclerViewSnap already does help me present only 4 rows per screen, but I was hoping to achieve this:

  1. User enters app, sees position 0 - 4 of the recycler view row.
  2. No matter how hard the user swipe / scroll, it will paginate to the next 4 position. Say if user were to scroll down, from the first screen (row 0-4), they will see position row 5-9. And if they scroll/swipe down again, they will see row 10-13. And if they swipe up from row 10-13, they will see row 5-9.

Thank you!

rubensousa commented 8 years ago

You can't do this with GravitySnapHelper. You'll need to create custom snaphelper that behaves likes you described. A ViewPagerSnapHelper would be a cool addition to this project, but it's not on my plans right now.