DevAhamed / MultiViewAdapter

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

Multipleviews #11

Closed kozmabalazs closed 7 years ago

kozmabalazs commented 7 years ago

Hi @DevAhamed,

I was reading the Multiple Data Sets section on the wiki and I wonder if it is possible to add a header view for each data set?

Also in this example I see that there are two separate list. How can we do if we have one list with different kind of views? (Ex.: a newsfeed where one item is a photo item, one a simple text item and they have different layouts)

Thank you.

DevAhamed commented 7 years ago

Yes, you can add headers to every data set. Here is the sample link

For the same data set, you can have two different binders. ie., PhotoBinder and TextBinder. The adapter will pick the correct binder. Kindly refer this example for that

DevAhamed commented 7 years ago

Feel free to re-open if you are still facing the issue.

ghost commented 7 years ago

How to remove header of that data set when the data is empty?

DevAhamed commented 7 years ago

You can call removeItem() on your DataItemManager object to remove the header once set.