How can we change the spanCount of RecyclerView dynamically?
My code create 3 column of cards in RecyclerView:
StaggeredGridLayoutManager mFavouratesLayoutManager;
mFavouratesLayoutManager = new StaggeredGridLayoutManager(3,
StaggeredGridLayoutManager.VERTICAL);
I'm trying to make the adapter like:
StaggeredGridLayoutManager does not support that. You can change the span count but it will effect every row. Your only option is to have full rows w/ SGLM.
If you use GridLayoutManager, you can achieve that by setting span count to 6, then providing a SpanSizeLookup that returns
Etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With