Is there a way to react to the progress of Animate...
# compose
e
Is there a way to react to the progress of AnimatedVisibility? My use case is that I have a list of composable functions, and I want to animate additions and deletions to it, so I'm wrapping each item in an AnimatedVisibility. The problem as I understand it is that I can't delete a function from the list until the transition is finished (because then it won't get composed anymore; is that the proper terminology?). My idea is to mark the item as deleted, and remove it once the transition is complete, but I'm not 100% sure how to do that.
d
When the
AnimatedVisibility
finishes animating out its content, the content will be disposed. For now you could add a
DisposableEffect
in the content like so:
Copy code
DisposableEffect(Unit) {
                        onDispose {
                            // Remove the item
                        }
                    }
😍 1
k
Thanks! That's real helpful.
👍 1