Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

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

Open
jpage4500 opened this issue Aug 6, 2018 · 1 comment

Comments

@jpage4500
Copy link

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..

@jmartinesp
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants