Long lists, like Contacts or Bookmarks, are annoying to scroll through. Most apps provide some way to jump through them quickly, like a handle on the edge of the screen that can be dragged down. This is definitely better than nothing, but from a UX perspective, it's not the best solution. Users have to watch the handle (or the list) as they’re scrolling to check what letter they’re on, and it makes users put in a little more mental effort than should be needed.
A better alternative is a glanceable list of indicators that the user can use to jump right to where they want to go; no mad flinging or speed reading required. However, this is sorely missing on Android. IndicatorFastScroll is Reddit’s take on it.
It works with any RecyclerView and any adapter; all it needs is a callback where you supply an indicator (like the first letter of the item) for a given position. Icons are supported as well. With this setup, you don't need to hold your list’s data in any particular way; lists and database cursors work perfectly fine. This is especially nice for database-backed lists, as if you know what sections the list contains, you get to avoid loading the entire list from disk to build them up! The indicators are automatically updated through the adapter, so any notify*() calls will also update the fast scroller accordingly.
It's also styleable like any Android widget; use whatever font, colors, and background you want.
This library makes heavy use of Kotlin. We love it at Reddit, and it's definitely made with Kotlin usage in mind, but it works just as well in plain Java. However, be aware that adding it to an app without Kotlin will increase your APK size, as the Kotlin standard library is a dependency.
There's a sample app in the project that shows some common use cases and features. Check the readme on GitHub for details.
Try it out!
implementation 'com.reddit:indicator-fast-scroll:1.0'
IndicatorFastScroll on GitHub
Bug reports and PRs always welcome!
We're really excited to be releasing this. We shipped it in the Communities screen in the Reddit app a few months ago, and we hope it'll be a big help to anyone here wanting this widget. Designers and users alike are big fans of having one.