MaterialFadeThrough

fun <T> MaterialFadeThrough(targetState: T, modifier: Modifier = Modifier, label: String = "MaterialFadeThrough", content: @Composable AnimatedVisibilityScope.(T) -> Unit)(source)

MaterialFadeThrough allows to switch between two layouts with a fade through animation.

Parameters

targetState

is a key representing your target layout state. Every time you change a key the animation will be triggered. The content called with the old key will be faded out while the content called with the new key will be faded in.

modifier

Modifier to be applied to the animation container.

label

An optional label to differentiate from other animations in Android Studio.

See also

com.google.android.material.transition.MaterialFadeThrough