2

I'm trying to achieve in Android a list of views that will look like this:

Couple of specific behaviours which made this a problem for me:

  • The list of views (in red), can be dynamic, and can vary in size
  • The views flow should be rows then columns, as follows:

]

I manage to achieve the first requirement with Recycleview and the layout manager StaggeredGridLayoutManager (setted the cell height on the adapter onCreateViewHolder).

StaggeredGridLayoutManager lManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.HORIZONTAL);

But the way the layout populate itself is in the opposite direction then what I need (it populate columns then rows, as follows)

3]

Or how it actually looks on the android app:

4]

Is it possible to set layout manager to lay items as I need? I tried other solutions like putting all the available views in a tablelayout, then toggle visibility, but it has it's limitations as well, and I prefer the recycleview solution.

Nadav96
  • 1,274
  • 1
  • 17
  • 30
  • Did you find a solution? I'm facing the same problem – Viktoriia Chebotar Dec 05 '16 at 09:52
  • I eventually dropped the recyclerview and created the Imageviews programmatically (calculating the dimensions of each view). It's not perfect, but it gets the job done... Hope it helps. – Nadav96 Dec 05 '16 at 18:13

0 Answers0