Hi I need a gridview which have 2 different layout in grid cells according to grid cell type.here is I am giving the example scrren drawn on paper.
See Question&Answers more detail:osHi I need a gridview which have 2 different layout in grid cells according to grid cell type.here is I am giving the example scrren drawn on paper.
See Question&Answers more detail:osUser RecyclerView
with GridLayoutManager
that have set SpanSizeLookup
. So it will be as follows:
int fullSpanSize = 3;
int normalSpanSize = 1;
GridLayoutManager layout = new GridLayoutManager(context, fullSpanSize);
layout.setSpaneSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return position == 3 ? fullSpanSize : normalSpanSize;
}
});
recyclerView.setLayoutManager(layout);