1

I know how to use staggered grid layout, but this layout design is beyond me. Can anyone tell me how to achieve this layout design? I have done layout design like this before.

enter image description here

But the desired layout is like this.

enter image description here

The problem is the 4th card can't be inflated as the way it is in the design, with staggered grid layout. So I want to know how I can achieve this type of layout.

Daniel Jr McCoy
  • 157
  • 1
  • 15

1 Answers1

2

You can use FlexboxLayoutManager

Use like this

FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(context);
layoutManager.setFlexDirection(FlexDirection.COLUMN);
layoutManager.setJustifyContent(JustifyContent.FLEX_END);
recyclerView.setLayoutManager(layoutManager)
AskNilesh
  • 67,701
  • 16
  • 123
  • 163