Android: how to populate ListView with alphabetical index and fastscroll, as in contacts application.?

I would like to implement a ListView with the fastscroll and albhabet index as in the contacts application. I am using a SimpleAdapter to populate a ListView. As you can see from the image, selecting the letter of the alphabetical indexer on the right, selecting listView jumps to the corresponding ListItem. How to do it? Please, help.

enter image description here

+6
source share
3 answers

As I do not see your posted image, but I think

Here is a way to implement indexing partitioning on Android, like iPhone, you should also refer to the Indexexer and alphabetindexer sections for such a custom implementation.

Try this, hope you need.

+5
source

I know that it's already late. However, there is a github repo with an android project with a list section heading and alphabet index. I also used a filter in it. Hope this helps someone.

enter image description here

+3
source

I will inform you briefly.

Creating the extends RelativeLayout class implements OnTouchListener

Define strings of alphabets

Find screen height in list view

Creating dianama text views is considered the same as the number of alphabets, text height View ==> screenWidth / alphabets.

Override the onTouch method.

Find the text view that is currently selected // Offset.

Create a handler to dispatch the event to mainList

Calling the Listview setSelectionFromTop method passes the position.

Done ...

0
source

Source: https://habr.com/ru/post/903281/


All Articles