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

Marcin Wisniowski

02/03/2022, 10:36 PM
I need to animate item additions/removals in a
LazyColumn
, which is currently not a built-in functionality (issue: https://issuetracker.google.com/issues/150812265). How are other people solving this? No animation is quite jarring and waiting a few months for an official implementation doesn't really work.
c

Chris Johnson

02/03/2022, 10:43 PM
I achieved this using
MutableTransitionState
and
AnimatedVisibility
. When a user deleted an item from the list, I changed the value of my MTS from true to false and had a
snapShotFlow
in a launchedEffect listen for when I should call remove (After the animation of animatedVisibility finished). A lot of our old built in 'free' functionality isn't added yet but all the tools to create it are.
👍 1