I have looked around and haven't found much, mainly because I'm not sure how to correctly ask my question to get the right results(something that always holds me up searching for questions).
I would like to set up a RecyclerView that has different views for each row. Although sometimes a few rows will have certain views repeat. And some views will be on all rows.
Right now I'm accomplishing this by casing out the binded position, and changing view visibility on a row by row basis. My assumption is that this is an improper way of doing it.
My searching has led me to believe an adapter with multiple holders will do it in a better way. I just can't seem to figure out how to best get it done.
Do I use a base view holder, and extend the others from it, maintaining a single rootview layout and adjust the holder that gets bound according to row position?
And Then change the individual rows' views on the binded position?
Or am I completely wrong?
Any help or advice would be great.
I ended up only needing 2 layouts. One for the common views and one for the ''preference'' views, eg the switch and toggle rows.
Now instead of having so many rows with useless gone views, I only have a few views that become unused at any point.
Thank you for everyone's help. This was bugging me for a few days.