I have a staggered grid that has 2 columns. This is working. What I want is at position 0 for the row to span across the 2 columns. I have done this before quite easily using GridLayoutManger as so:
mGridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return position == 0 ? 2 : 1;
}
});
StaggeredGridLayoutManager doesn't provide me with this functionality like GridLayoutManager does.
Is there a different way of doing this? I have searched but not found anyone with the same problem, which is surprising as I would think this functionality would be quite useful for my scenario and for infinite scrolling, when a ProgressBar is shown in the last row of the RecyclerView.
You can use the setFullSpan method.
In this way the item will layout using all span area.
Something like this:
Pay attention.
It supports views that span all the columns, but it should be enough for your case.