Any reason why `AnimatedVisibility` doesn’t have a...
# compose
j
Any reason why
AnimatedVisibility
doesn’t have a callback when the animation finishes?
d
We could provide a way to make the animation state in
AnimatedVisibility
observable if there's a need. 🙂 Curious what is your use case?
j
@Doris Liu Deleting an item from a list via the
SwipeToDismiss
composable. I would like the item to animate away with
AnimatedVisibility
, then I delete the item from my data once the animation completes
d
Makes sense. We will look into making `AnimatedVisibility`'s animations observable in the future. For now you could add a
DisposableEffect
in the item and use the
onDispose
callback as the signal for when the item has finished animating out. 🙂
j
Great thanks! Yep we’re using
onDispose
as a workaround for now
👍 1