How to create complex ListView with grouped items?
-
I'm trying to create ListView adapter for grouped contents. I cannot use just multiple types of list items, because I've got complex design(image is not real design, but the layout): You can see from image, that there are list item views inside group view. And group view has set background for whole group, not just for its header. Therefore I cannot use ExpandableListView either: http://www.mobiledevguide.com/2012/09/how-to-work-with-android.html. Is it possible somehow possible to implement that design using few inflated elements, and on-demand content population for these elements like ListView does? Or do I need to implement whole widget on my own? I've took quick look at ListView sources. It is almost 4k LOC! I know, that something similar is possible using hack: 3 types of list items: header, item, last_item_of_group. And fake background of group using these different items (header,item,item,item,last,header,item,item,...), but I can't do that now!
-
Answer:
You can try using Expandable Listview. http://developer.android.com/reference/android/widget/ExpandableListView.html
Miro at Stack Overflow Visit the source
Other answers
I think you can use the MergeAdapter, I had done a similar view as the one you desire. https://github.com/commonsguy/cwac-merge
Mohamed Hamdaoui
Related Q & A:
- How To Create My Own Classifieds?Best solution by Yahoo! Answers
- How To Create A Profile In Facebook?Best solution by Yahoo! Answers
- How to create a complex doxygen alias?Best solution by Stack Overflow
- How to refresh a listview within a Fragment?Best solution by Stack Overflow
- How to create a Database in FoxPro and how to retrieve and sort it out?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.