Dynamic content inside a list in Android

I want to display list A Cardview and inside each Cardview, I need to have X buttons . Here A is a constant (say 30), while X can be changed by the user (depending on his / her preferences, it will not exceed 15).

To build this, my first reaction as a beginner was to get RecyclerViewinside each element RecyclerView. Although several SO answers try to suggest a way to do this, it looks a little messy.

Another way I thought would be to place these 30 Cardviewwith different identifiers inside my layout file, but managing them will be a huge pain.

I need a way that is cleaner than I thought above. What would be the best way for me to solve the above problem?


Edit

Well, therefore, idea No. 3 should have RecyclerViewwith CardViewswith static content and a fixed strip of buttons at the bottom, and not inside it.
I would prefer a solution to the original problem, but if all else fails, this is what I am going on.

+4
source share

Source: https://habr.com/ru/post/1664471/


All Articles