https://kotlinlang.org logo
#compose
Title
# compose
j

Joel Anderson

08/01/2022, 2:58 PM
Hey folks, I am trying to create a collapsible section in a lazy column that can contain (potentially) hundreds of list items. I'd like this section to be expandable and collapsible with change animations. I've seen Google recommend to use
AnimatedVisibility
for hiding list items, but this has a negative potential side effect when that list of hidden items is very large: when you scroll past the collapsed section, the LazyColumn tries to recompose all the hidden items at once and drops frames or potentially freezes. I've filed the issue here: https://issuetracker.google.com/issues/240599812 but am not sure if anyone has any alternatives? For now we've settled on just removing the items from the lazy list when they are not visible, but that breaks our change animations.
2 Views