How to implement an Expandable RecyclerView where the child is having a grid structure?

398 Views Asked by At

I need to have an expandable view where the parent/expandable title will have a text and drop-down arrow. Children of each such title should be a view having multiple items in a grid structure. (Kind of like a recycler view with GridLayoutManager). Please find the attached image for reference. enter image description here

Each year corresponds to the group title, and the cover arts shown corresponds to the children.

1

There are 1 best solutions below

0
On

We will have an ExpandableListView, for which the adapter returns 1 for getChildrenCount(int groupPosition) andgetChild(int groupPosition, int childPosition) returning null. And the childView for the ExpandableListView will have a recycler view. This is one way to do it. [Tried and working]

One more way could be using two RecyclerViews, which I haven't tried. The parent RecyclerView having a linear layout manager and the child recycler view with grid layout manager.