DevAhamed / MultiViewAdapter

Easily create complex recyclerview adapters in android
https://devahamed.github.io/MultiViewAdapter
Apache License 2.0
820 stars 149 forks source link

Repeating menu groups in a single list #58

Open indoomni opened 6 years ago

indoomni commented 6 years ago

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.

DevAhamed commented 6 years ago

This can be achieved by two ways.

  1. You can add it like,

    --DataItemManager (1 item) --DataListManager (multiple items) --DataItemManger (1 item) --DataListManager (multiple items)

  2. 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.