In many new android applications and their latest update those applications(mostly material design) have a custom scrollbar with letters and numbers, while scrolling the scrollb
I use this new one now - https://github.com/L4Digital/FastScroll
Below is my previous one.
I have used fastscroller by FutureMind in Android Studio
https://github.com/FutureMind/recycler-fast-scroll
Usage
1) Compile required dependency by adding
compile 'com.futuremind.recyclerfastscroll:fastscroll:0.2.4'
2) Edit Layout File to add FastScroller
3) In Activity/Fragment associate fastScroller with your recycler view
recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
fastScroller = (FastScroller) findViewById(R.id.fastscroll);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter);
//has to be called AFTER RecyclerView.setAdapter()
fastScroller.setRecyclerView(recyclerView);
4) In your RecyclerView.Adapter implement SectionTitleProvider to display the content on Bubble
public class MyAdapter ... implements SectionTitleProvider{
...
@Override
public String getSectionTitle(int position) {
//this String will be shown in a bubble for specified position
return getItem(position).substring(0, 1);
}
}