I'm trying to build a RecyclerView with a GridLayoutManager which has a variable column count per row, something like this:
The sum of the width of all items in the same row will always be the screen width.
I tried to re-organize the list of items, grouping them by list of rows, and then inflating a LinearLayout per row. It didn't work quite well.
So I'm stuck and out of ideas. Any help would be really appreciated
You can use GridLayoutManager. To have different column count in row you have to override setSpanSizeLookup.
Example:
I code sample above I just show have you can change item size. Pay attention that
spanSize
<=spanCount
.