Android ListView with fast scroll
using alphabets in the right side of the screen
We have lot of questions like
Alphabetical
sorted listview with Alphabetic section using Adapter in Android application.
Listview
alphabetical index programmatically
In IPhone we
are having Indexed UITableView.
Android
Listview like iphone contacts list (alphabets
in right side of the list)
We
are not having similar functionality in android but we are having android:fastScrollEnabled
and alphaIndexer.
Without
using android:fastScrollEnabled and alphaIndexer. Just with touch
recognition, alphabetically sorting can be achieved easily.If you want to implement the same feature in android and solution for all the above questions, we can try this approach
Code: indexTableCode
Screen Shot:
Thanks for reading :)
If you have any other quick thoughts/hints that you think people will find useful, feel free to leave a comment.
Thanks Vardhan,you have helped a lot.
ReplyDeletehi vardhan thanks for the tutorial i t hlped me lot
ReplyDeletecheck out the android app we have just released https://play.google.com/store/apps/details?id=com.smartappgenerator.dailyquiz
you have helped a lot..how to get onItemClickListener in our example.
ReplyDeleteUpdated Code is added.
DeleteHave onclick listener to the linearlayout in getView method.
thanks, same code with sticky headers will be awesome https://github.com/emilsjolander/StickyListHeaders
DeleteThanks bro
ReplyDeleteHello vardhan,
ReplyDeleteThank you for your tutorial
I want to use your solution but with Fragment.
After making transformation to replace Activity by Fragment , I am getting blank screen.
Please help.
Fred
Hi Fred,
DeleteI haven't tried anytime with fragment.
Let me give it a try.
Thanks & Regards
Harsha
Hey Vardhan thanks for this example, very usefull, how should I do for showing in bold the letter which I've selected?
ReplyDeleteThanks.
hi vardhan , i m not able to download ur demo project.plz help
ReplyDeletehttps://sites.google.com/site/vardhanexp/-site-vardhanexp-indextablecode/IndexTable.zip?attredirects=0&d=1
DeleteGovind, link is working, You can check with above link
Great man
ReplyDeleteI want to open a new activity on click of a list item pls help its urg....i have tried it from you userlistadapter click listener but no luck?????
ReplyDeleteYou can call other activity in onClickListener.
DeleteCheck out this link : https://sites.google.com/site/vardhanexp/-site-vardhanexp-indextablecode/IndexTable.zip?attredirects=0&d=1
Hello Vardhan Thanks for your post its a really nice tutorial i just want to know that if u want to show selected list as highlight like in contact of phone than what you will do.
ReplyDeleteHi Agarwal,
DeleteI have shared source code, just have a look of it. :)
Hello Vardhan. Excellent app. I am just getting started with Android programming and am having difficulty figuring out where and how to modify to import from a database instead of the Book list you have. If you could point me in the right direction I would appreciated it.
ReplyDeleteThank you,
Jeffery
Dear Jeffery,
DeleteCustomize getUserList method from UserService class according to your needs, we can retrieve cursor object from database and convert cursor object to List of Book Object
Hope above information helps you. If your facing any difficulties I can help you.
ALL THE BEST
Regards
Harsha
Dear Vardhan,
ReplyDeleteI modified ur getUserList method in UserService but i can not fetch contact in that class.
Please help me...
Dear Murugan,
DeletePush the source code from the post, you can see the changes.
Regards
Vardhan
Harsha
Vardhan,
ReplyDeleteThanks for the help, got the DB working to populate the list. One other issue that I am not sure where to modify. When one of the fields begins with a lower case such as "eBay" it creates a new section at the end of all the CAPS and adds an "e" to the bottom of the alphabet side bar. Not sure where both of these are handled.
Thanks,
Jeffery
Dear Jeffery,
DeleteIts handled at 2 places.
Sort technique in Book and CustomListIndex classes.
I have modified my source code as per your requirement please have look:
https://sites.google.com/site/vardhanexp/-site-vardhanexp-indextablecode/IndexTable.zip?attredirects=0&d=1
Regards
Harsha
Can you make it using recyclerview
DeleteHarsha,
ReplyDeleteThanks, worked great. I just added in to make the alphabet letter uppercase if it is lower the first time added. Also, if the main list is empty I had to error trap for the "tmpIndexListSize" in the CustomListIndex to avoid an error. Once again thanks for the help.
Jeffery
Thanks Vardhan, beautiful code.
ReplyDeleteHarsha,
ReplyDeleteAll is working well. Just noticed that of the Book Title is only one character, it has an issue. could you point me where to investigate this for a fix?
thanks,
Jeffery
very good blog it helped me lot , Thanks sir
ReplyDeleteI need help about alphaindexer in this tutorial. Please upload as may RoboGuice tutorials as possible.
ReplyDeleteYes Surendra, what help do u required?
Delete