1

enter image description here

What is the best possible way to achieve a Recycler view which has items arranged as shown in the above image. The items have a main title and then number of sub items(the count of sub items is dynamic) and each tile have different number of sub items. Thank you for all your help.

luckylukein
  • 819
  • 1
  • 7
  • 17

1 Answers1

1

Have a look at the answer for How to create RecyclerView with multiple view type?. You basically want two types and as for the data, you can hold it in an array that has objects that contain title + array of items. When you need to get view you just compute the type to use (title or item) according to the position.

Community
  • 1
  • 1
Doron Yakovlev Golani
  • 5,188
  • 9
  • 36
  • 60