Daniel Jr McCoy
Daniel Jr McCoy

Reputation: 167

Adding Horizontal full screen card in staggered grid layout in android

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.

Upvotes: 1

Views: 390

Answers (1)

AskNilesh
AskNilesh

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

Related Questions