lisawray / groupie

Groupie helps you display and manage complex RecyclerView layouts.
MIT License
3.66k stars 293 forks source link

How to switch from list layout to grid layout using groupie ? #424

Open aeroxr1 opened 2 years ago

aeroxr1 commented 2 years ago

Hi , I have to show a list of grouped items using groupie. The user can choose the way the items are been showed on screen: list layout or grid layout.

In the past I have done it setting dinamiically the span count of a gridviewlayout. When the span count was 1 I returned the view type of a list element, when was > 1 I returned the view type for a grid view. ( something like this https://medium.com/xorum-io/android-recyclerview-animated-transition-between-grid-and-list-layouts-b2309e1d9f19 ) In groupie I don't know how to do that.

aeroxr1 commented 2 years ago

@Zhuinden I thought to recreate the model view every time the user clicks on switch button, but it is soo expensive. I'm hoping is there a different way