I have a collection of photos and I use RecyclerView to display them. I want to have the first element in my RecyclerView span 2 columns AND 2 rows:

How can I achieve this, I know that with GridLayoutManager you can do it
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
if (position == 0) {
return 2;
} else {
return 1;
}
}
});
but this only applies to columns, not rows. So, how can I achieve this layout in RecyclerView ?, Note: this layout is used on instagram and Google Photos.
this question was asked, but without the solution "Good solution"
source
share