turing-tech / MaterialScrollBar

An Android library that brings the Material Design 5.1 sidebar to pre-5.1 devices.
Apache License 2.0
781 stars 126 forks source link

Snap the fast scroll to a given percent of the scroll progress #92

Closed klinker24 closed 7 years ago

klinker24 commented 7 years ago

Not sure if this is something you would be interested in, or not, but it worked well for my implementation.

Basically, instead of smooth scrolling through every single percentage point on the list, this makes it so the fast scroll can snap to certain percentage points.

For example: Setting the snap percent to 0.05 would make the list snap to 95%, 90%, 85%, etc.

My use-cases (for an SMS app) was that I had a massive, time-series list of messages. With the current implementation, it was really had to find anything at all, because the slightest movement up or down on the scroll bar would jump 20 days and you would lose your spot. By snapping to 5% increments, it eased things out a bit, for the user, by providing that allowable buffer.

snap-scroll

I think the main use-case for this would be the time sensitive lists, rather than the alphabetically sorted ones.

turing-tech commented 7 years ago

Looks good. I'll check it out later today when I get to my computer.