BeksOmega / looping-layout

A looping LayoutManager for the Android RecyclerView.
Apache License 2.0
271 stars 16 forks source link

Add Smooth Scrolling Support #6

Closed BeksOmega closed 4 years ago

BeksOmega commented 4 years ago

:key: Use case

Developers want to be able to scroll their recyclers programmatically, particular looping recyclers. This allows you to create automated "carousels" that show news, advertisements, or other types of content.

:hammer: Proposal

One option might be to create a custom SmoothScroller specifically for the LoopingLayoutManager. This would allow the SmoothScroller to implement the custom strategies and directions for scrolling, like discussed in #5

The problem is that the subclasses of SmoothScroller seem to implement different animation strategies, while all using the default findViewById() behavior.

It would be optimal to support different methods for choosing the target view, and different methods for animating to it, but it seems like that will be complicated with the current inheritance structure.

More research needs to be done in this area. A feature request to the AOSP about supporting both custom animations, and custom view decisions might need to be made.

:wrench: Alternative

It might be worth researching adding extension function to the SmoothScroller class? But I don't know that they will be very effective.

:memo: Other info

N/A

:bee: Request for assignment

I'm just requesting this feature. But I don't mind implementing it.