MarkRS
07/04/2023, 10:15 AMStylianos Gakis
07/04/2023, 10:24 AMMarkRS
07/04/2023, 11:09 AMStylianos Gakis
07/04/2023, 11:12 AMMarkRS
07/04/2023, 11:29 AMStylianos Gakis
07/04/2023, 11:34 AMColumn {} so it’s the same as just adding 1 item to the big list. Just while making sure that it by itself isn’t also scrollable and therefore would try to take up an infinite height.MarkRS
07/04/2023, 11:37 AMStylianos Gakis
07/04/2023, 11:39 AMdewildte
07/04/2023, 5:20 PMMap<CategoryItem, List<ListItem>> for example.
Next, represent each item in the list as a separate LazyListScope.item , including the CategoryItem item.
Wrap each individual item in the list that is not a category in the AnimatedVisibility Composable.
When the user clicks on the chevron then iterate over all the items in that category and update their visibility to false.
Something like this:
onClick = { categories[categoryItem]?.forEach { item -> item.isVisible = false } }
Each individual item under the category item will dissapear.
Instead of a Map you could use a custom data structure too.
There are some advantages to doing it this way for instance:
• Being able to display the categories as stickyHeader s
• Being able to dynamically scroll to any item in the list
◦ This is not possible if the items below the category is a big Column.
◦ Being able to selectively show or hide an item in the category even when it is expanded.dewildte
07/04/2023, 5:28 PMdewildte
07/04/2023, 5:35 PMenter and exit specs in the AnimatedVisibility to expandIn and shrinkOut respectively.MarkRS
07/06/2023, 11:03 AM