leochuan / ViewPagerLayoutManager

ViewPager like LayoutManager which supports some awesome animations and infinite scroll.
Apache License 2.0
1.75k stars 330 forks source link

Wondering why AutoPlaySnapHelper extends CenterSnapHelper instead of PageSnapHelper #53

Closed jilulu closed 6 years ago

jilulu commented 6 years ago

... since the documentation of PageSnapHelper says

Used by {@link AutoPlayRecyclerView} to implement auto play effect

Would there be side effects if in a production project, I changed AutoPlay's inheritance to subclassing PageSnapHelper?

Thanks so much!

leochuan commented 6 years ago

I used PageSnapHelper to implement auto play at first. But I find it scrolled more than one item sometimes, because before it was considered as fling, maybe you have already dragged it to the next position.I haven't figured out the proper way to solve this problem without rewrite the onTouchEvent of RecyclerView. So I left it as a imperfect PageSnapHelper and just forgot to change the comment, srr.

Cause PageSnapHelper extends CenterSnapHelper and only rewrite onFling, You can change AutoPlay's inheritance to subclassing PageSnapHelper. But still, it is imperfect.

jilulu commented 6 years ago

Thanks for the prompt response! Closing this one.

(BTW that's an outstanding library you've built. )