AnimatedVisibilityScope

The receiver of an animated container's content.

The container is a Foundation layout, so the content takes the ConstrainedScope modifiers.

The content stays mounted until every animation registered on transition has finished, including the content's own:

AnimatedVisibility(visible = expanded) {
val inset by transition.animateInt { if (it == EnterExitState.Visible) 16 else 0 }
Label(text = "Details", modifier = SwingModifier.emptyBorder(inset))
}

Inheritors

Properties

Link copied to clipboard

The transition that drives every animation of this enter or exit.

Functions

Link copied to clipboard
@Composable
fun <S> ConstrainedScope.AnimatedContent(targetState: S, modifier: SwingModifier = SwingModifier, transitionSpec: AnimatedContentTransitionScope<S>.() -> ContentTransform = { ( fadeIn(animationSpec = tween(220, delayMillis = 90)) + scaleIn(initialScale = 0.92f, animationSpec = tween(220, delayMillis = 90)) ).togetherWith(fadeOut(animationSpec = tween(90))) }, contentAlignment: Alignment = Alignment.TopStart, label: String = "AnimatedContent", contentKey: (targetState: S) -> Any? = { it }, content: @Composable AnimatedContentScope.(targetState: S) -> Unit)

A container inside a Foundation layout that animates between the contents of its states.

Link copied to clipboard
@Composable
fun ConstrainedScope.AnimatedVisibility(visible: Boolean, modifier: SwingModifier = SwingModifier, enter: EnterTransition = fadeIn() + expandIn(), exit: ExitTransition = shrinkOut() + fadeOut(), label: String = "AnimatedVisibility", content: @Composable AnimatedVisibilityScope.() -> Unit)

A container inside a Foundation layout that animates content in and out as visible changes.

@Composable
fun ConstrainedScope.AnimatedVisibility(visibleState: MutableTransitionState<Boolean>, modifier: SwingModifier = SwingModifier, enter: EnterTransition = fadeIn() + expandIn(), exit: ExitTransition = fadeOut() + shrinkOut(), label: String = "AnimatedVisibility", content: @Composable AnimatedVisibilityScope.() -> Unit)

The MutableTransitionState counterpart of the Boolean overload inside a Foundation layout.

Link copied to clipboard
open fun SwingModifier.animateEnterExit(enter: EnterTransition = fadeIn(), exit: ExitTransition = fadeOut(), label: String = "animateEnterExit"): SwingModifier

Gives this component its own enter and exit, running on transition and combined with the container's. The container stays mounted until this component has finished animating too.

Link copied to clipboard