I want to create a ui that like below :
There are some view and layout for this behaviour on android.
GridView: Fixed column number. It is useless for upper case.
StaggeredGridLayoutManager: Constructor requires span count. It is useless for upper case.
GridLayoutManager: It don't need a fixed column count.
GridLayoutManager layoutManager = new GridLayoutManager(this, 6);
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
switch (position % 5) {
case 0:
case 1:
return 3;
case 2:
case 3:
case 4:
return 2;
}
throw new IllegalStateException("internal error");
}
});
But I have to give a column number for each row. How can I do this task on android like ios?