Hello everyone, I was trying to group list of events by day and sort the events within that day and I ran into a problem when I try to group the events for a given day by event type and still sort the whole events for that given day by start time regardless of the event type. Open to any suggestions. Thanks.
I would personally create some data classes so you don’t have a bunch of maps. I see this is in the compose channel, so I’ll add that this shouldn’t be done inside a composable. The sorting should happen in your state holder (if you get events from a DB, you can set up a flow to handle the above transformation and use
collectAsState
in your compose code.
n
Nebil
01/05/2023, 5:59 PM
I do have data classes and the mapper is working fine the problem is when I sort the events one group always comes on top.
Examples
I have
9am type a
10am type b
11am type a
This should display as it is but it always displays group 'type b'up top.