Nacho Ruiz Martin
02/08/2022, 6:54 PMforEach
?
Simplified version of the parent Composable looks like this:
val items: MutableList<...> = ...
Column() {
items.forEach { item ->
ChildComposable()
}
}
AnimatedVisibility
applied in parent doesn’t work because the parent is always there. Applying it to the children works on enter but not en “exit” because when the item disappears from the list there’s no longer a child Composable to “exit”.
Thanks! 🙇Albert Chang
02/08/2022, 7:10 PMModifier.animateContentSize()
on the parent.Nacho Ruiz Martin
02/08/2022, 7:47 PMfadeIn
and slideInVertically
to enter and fadeOut
and slideOutVertically
whenever it’s added or removed from/to the list.Chris Sinco [G]
02/08/2022, 9:08 PManimateEnterExit
modifier on the child Composables?Chris Sinco [G]
02/08/2022, 9:10 PMNacho Ruiz Martin
02/08/2022, 9:15 PManimateEnterExit
but if I didn't missunderstood it, it's only to modify the enter/exit animation of the children when the parent's visibility is modified, which is not happening here.
I found this and it looks promising but a bit hacky. Also this but I suspect that it'll only work with LazyLists.
I will test those solutions, anyway 😄.Doris Liu
02/08/2022, 10:47 PMAnimatedVisibilityLazyColumnDemo
that you linked here would be helpful for your item removal use case. The main idea there is that the composable for the deleted items need to be retained until they finishes exiting.
We are exploring more straightforward ways to achieve this type item addition/removal in LazyColumn. @Andrey Kulikov might be able to share some insights.Andrey Kulikov
02/08/2022, 11:13 PMNacho Ruiz Martin
02/09/2022, 7:18 AM