I want to create a RecycleView with 4 CardViews aligned in grid mode and the last one in list mode, is that possible? Do I need to customized LayoutManager?
Asked
Active
Viewed 61 times
0
-
1By your description it looks like the layout will always have 5 elements. Just make static UI without using a recyclerview – Mehmet K Oct 13 '16 at 15:20
1 Answers
0
You can use a SpanSizeLookup
on your GridLayoutManager
:
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return position == 4 ? 2 : 1;
}
});

Bryan
- 14,756
- 10
- 70
- 125