MultiViewAdapter
MultiViewAdapter copied to clipboard
Repeating menu groups in a single list
Hello. Been using your library since yesterday, and it has been wonderful. Thanks for the effort.
Having a question here.. how do I build such a list:
header a item a1 item a2
header b item b1 item b2
where basically header a and b are the same object type, and items a1, a2, b1 and b2 are also the same type.
If in the adapter I have two list managers (say, headers and items), then headers will grouped at the top, and all of the items will be grouped below.
Maybe this is just a stupid question, but really appreciate any help. Thanks beforehand.
This can be achieved by two ways.
-
You can add it like,
--DataItemManager (1 item) --DataListManager (multiple items) --DataItemManger (1 item) --DataListManager (multiple items)
-
Using DataGroupManager. Kindly take a look into this wiki page - https://github.com/DevAhamed/MultiViewAdapter/wiki/Expandable-Group Only caveat here is you need to set the group expansion policy as multiple and set all the groups as expanded by default.