Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android equivalent to iphone indexed UITableView

Tags:

android

iphone

I am porting an iPhone app over to the Android platform. One of the views has a very large list of data and on the iPhone app, there's a scrollbar of sorts on the right hand side that displays the letters of the alphabet and allows the user to quickly scroll through the list this way. I am having trouble finding such functionality in Android. Is there a simple way to implement this?

like image 521
MattC Avatar asked Oct 14 '22 14:10

MattC


2 Answers

I think this is implemented through AlphabetIndexer, though I have not tried it personally.

like image 112
CommonsWare Avatar answered Nov 10 '22 01:11

CommonsWare


The Android way to do this is to make the list filterable using the keyboard, like a Blackberry. You should do it this way to fit in with the platform experience.

To implement this, you call the setTextFilterEnabled(boolean textFilterEnabled) method on your list view. See example below:

myListView.setTextFilterEnabled(true);

For a complete example, see Hello, ListView.


If you can't use that, then you can use the fast scrolling like seen in the Contacts application. This is not a public API yet, but you can implement it from the Contacts source code at https://android.googlesource.com/platform/packages/apps/Contacts .

like image 36
Isaac Waller Avatar answered Nov 10 '22 01:11

Isaac Waller