SpannedGridLayoutManager icon indicating copy to clipboard operation
SpannedGridLayoutManager copied to clipboard

method to change initial 'span' value? ie: GridLayoutManager.setSpanCount()

Open jpage4500 opened this issue 7 years ago • 1 comments

I want to change the number of columns/spans when the user rotates the device - I was doing this using GridLayoutManager#setSpanCount() but don't see a similar method available for SpannedGridLayoutManager. Does one exist and I'm just missing it?

I ended up re-creating the layout manager after device rotates but at least it seems like this would be good to add if it makes sense..

jpage4500 avatar Aug 06 '18 21:08 jpage4500

Sorry for the late response. I don't think I understand your use case, since when the screen rotates the Activity / Fragment / any other view-based controller should be recreated and the RecyclerView and its LayoutManager with it.

Even if the RecyclerView didn't get recreated, there would be not much difference between just setting a new spanCount on the current LayoutManager and creating a new one with that new value, since resetting the spanCount would mean recalculating everything and recycling every view.

jmartinesp avatar Oct 07 '18 08:10 jmartinesp