Reputation: 371
How to Achieve this layout shown in below image Please suggest me how to make layout at run time while my contain is loading directly from web service.
Upvotes: 0
Views: 1327
Reputation: 783
You can use FlexboxLayoutManager for this, here is the snippet
FlexboxLayoutManager layoutManager = new FlexboxLayoutManager();
layoutManager.setFlexWrap(FlexWrap.WRAP);
layoutManager.setFlexDirection(FlexDirection.ROW);
recyclerView.setLayoutManager(layoutManager);
And in Gradle file you will have to compile this dependency
compile 'com.google.android:flexbox:0.3.0-alpha3'
for more you can check this link here
Upvotes: 2