Hello Can i make like this image with recycle-view layout manger? and this image show what i want to do thank in advance.
Asked
Active
Viewed 75 times
-1
-
1for further clarifications...you can ask me.. – Santanu Sur Jan 02 '18 at 18:27
-
1@SantanuSur thank you but can you give a simple code of that – MyBooK InMyApp Jan 02 '18 at 18:35
-
Possible duplicate of [Dynamic Grid Layout](https://stackoverflow.com/questions/27416461/dynamic-grid-layout) – Chisko Jan 02 '18 at 19:31
3 Answers
0
Yes u can ...in recycler_adapter
check if position == 0
then make the two cardsview visible
and set them... and in else {cardview4 ,cardview5,cardview6 visible
and set them and make cardview1 and cardview2 Gone
the inflate layout will contain a relative lat
yout with two horizontal linearlayouts
just hide make the layouts gone and visible at proper position in onBind()

Santanu Sur
- 10,997
- 7
- 33
- 52
0
Use ReycyleView
using GridLayoutManager
manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
if (position == 0) {
return 2; // Splitting into 2 columns
} else {
return 3; // Splitting into 3 columns
}
}
});

Ramesh sambu
- 3,577
- 2
- 24
- 39
0
for achieving this view i think GridLayoutManager
with it's setSpanSizeLookup()
method is the best choice. you can find complete explanation in this answer. In case you face any problem while implementing you can ask.

Raghav Sharma
- 324
- 1
- 7
-
how can i implement // RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this,2); – MyBooK InMyApp Jan 02 '18 at 21:57
-
can you please elaborate your problem so that i can solve your problem......i am not getting your point. – Raghav Sharma Jan 05 '18 at 19:22