Hi how can i implement a list with section divider like the one on android's building blocks lists
Can you point any articles or tutorials to achieve this?
I implemented a possible version here:
http://steprobe.wordpress.com/2013/03/29/google-building-blocks-style-listview-for-android/
There are many tutorials to get grouped lists. The trick is to look for "adapter" and not "list". For instance, this one: http://android.cyrilmottier.com/?p=440
Each row in your list can be totally separated in terms of layout from others. So if you got 3 rows on your list, you can have each one can look totally different. You need to write your own adapter (i.e. extending ArrayAdapter), override getView()
, getViewTypeCount()
and getItemViewType()
. Then for each row your getView()
shall do any logic you want, inflate any layout you want and return that View to the list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With