Reputation: 167
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.
But the desired layout is like this.
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.
Upvotes: 1
Views: 390
Reputation: 69689
You can use FlexboxLayoutManager
Use like this
FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(context);
layoutManager.setFlexDirection(FlexDirection.COLUMN);
layoutManager.setJustifyContent(JustifyContent.FLEX_END);
recyclerView.setLayoutManager(layoutManager)
Upvotes: 2