Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom List View With Custom Headers Android

I have to make a custom list view with custom header, ( different text in each headers) and different number of items below each header. I have been going through various section indexing examples but I think they are not relevant much to my answer.

Anybody please suggest me a good means to move around such type of list view in android.

enter image description here

like image 999
Gaurav Arora Avatar asked May 17 '13 05:05

Gaurav Arora


4 Answers

This might be a duplicate of Android Listview with sections

There are lots of different ones out there. One example is: http://w2davids.wordpress.com/android-sectioned-headers-in-listviews which uses: http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09

That one allows you to pass in different array adapters for each section so that you can have different layouts for each section's items.

If you were more clear about what the ones you have seen fail to do that you need it would be easier to offer you something you haven't seen.

like image 167
Jerry Jeremiah Avatar answered Nov 11 '22 09:11

Jerry Jeremiah


There has been lot of thread exists on the Stackoverflow, check:

  1. Android Listview with sections
  2. Android ListView section header
  3. How to draw a section header in Android listview just like the Contacts app did ?

But I am not sure these threads has helpful info, but if you want to read, understand and implement ListView with sections then here is one of the great and detailed article given by Cyril: ListView Tips & Tricks #2: Sectioning Your ListView

like image 28
Paresh Mayani Avatar answered Nov 11 '22 09:11

Paresh Mayani


For a more complex design with sections in list, you should try this very standard library : https://github.com/emilsjolander/StickyListHeaders.

Other alternatives mentionned are great.


I should mention that the only drawback of this library is a poor mavenization and its absence on central.

like image 20
Snicolas Avatar answered Nov 11 '22 08:11

Snicolas


Try this tutorial..its very nice and simple http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/

like image 2
Asthme Avatar answered Nov 11 '22 09:11

Asthme