Background
On ListView, you could have a fast scroller which allowed you to drag a scrollbar to easily scroll to wherever you wished (using fastScrollEnabled attribute)
Together with "SectionIndexer" class and optionally some attributes, you could have a nice popup that shows as you use this scrollbar (link here).
Such a thing is shown on the contacts app so that you could scroll easily to specific letters.
The problem
RecyclerView doesn't seem to have any of those. Not even a fast-scroll.
The question
How do I add a fast scroller functionality for the RecyclerView?
You can try our lib: https://github.com/FutureMind/recycler-fast-scroll. It's still in early development, but was built specifically to deal with smoothness issue we experienced with other libraries. It uses a little bit different mechanism. It supports horizontal LayoutManager as well and will also support multi-column setups in near future.
Edit: there are some neat customisation options now.
You can as well use A-Z Fastscroll for RecyclerView. It is the iOS style.
https://github.com/code-computerlove/FastScrollRecyclerView/
How to use it:
android.support.v7.widget.RecyclerView
withcom.codecomputerlove.fastscrollrecyclerviewdemo.FastScrollRecyclerView
getMapIndex()
. The function should return the mapIndex. Look intocalculateIndexesForName()
for inspiration on how to create it. Once created pass it to the adapter in the constructor.FastScrollRecyclerViewItemDecoration
and add it on your RecyclerViewFastScrollRecyclerViewItemDecoration decoration = new FastScrollRecyclerViewItemDecoration(this); mRecyclerView.addItemDecoration(decoration);
<dimen name="fast_scroll_overlay_text_size">100dp</dimen>
to your/values/dimens.xml
file. This is the dp size of the overlayed letterFastScroller functionality is added from android library 26.0.0 for RecyclerView
compile dependency
add depedency to project.gradle
your recyclerview.xml file
thumb.xml
line.xml
thumb_drawable.xml
line_drawble.xml