rubensousa / GravitySnapHelper

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

Fixed first and last item snap behavior #7

Closed shihochan closed 8 years ago

shihochan commented 8 years ago

I was going to fix first and last item snap behavior.

Now, the last item of Gravity.START and Gravity.TOP can't show completely. Below is the screen shot:

And the first item of Gravity.END and GRAVITY.BOTTOM have a same issue. I was going to fix it.

rubensousa commented 8 years ago

Can you make this behavior optional by adding a setter method? I prefer the default behavior, that's why I didn't had this initially.

shihochan commented 8 years ago

@rubensousa Thank you for your reply. You are right.

Can you make this behavior optional by adding a setter method?

I will fix it!

Zanexess commented 8 years ago

I found the issue with android:clipToPadding="false" in this solution. For example we have outer vertical RecyclerView and some horizontal recyclers inside of it. Left and right padding of every inner recyclerView for example 10dp. We save the position of every inner recycler, while scrolling. When we back, clip to padding affects wrong. Any ideas, how to fix it?

rubensousa commented 8 years ago

@Zanexess, this sample also uses clipToPadding=false and the behavior seems fine. I'm going to release 0.2 soon, so I suggest you to try it. If there's something wrong, just create an issue. Closing this as it'll be added in 0.2