Post

👀 Compose 1.13.0-alpha01 introduces a new CapturedAnimatedVisibility composable: It instantly disposes child content on exit, animating a static GraphicsLayer snapshot instead of keeping UI nodes alive. Our testing has shown: ⚡ ~8% faster exits 📉 ~7% fewer recompositions

2 reposts19 likes

It is always odd to have AnimatedVisibility being toggled by a null check of an object that is also accessed inside the lambda. Thought the solution might be to provide the last non-null value of the object in the lambda, similar to what AnimatedContent does. But this maybe works even better.

Standard AnimatedVisibility can cause crashes during item deletion because it continues to attempt composition on the removed item, leading to bugs when the underlying data is no longer available 😢 Check out the reference documentation here: developer.android.com/reference/ko...

developer.android.comCapturedAnimatedVisibility  |  API reference  |  Android DevelopersCapturedAnimatedVisibility animates the appearance and disappearance of its content as visible changes.