AnimatedContentScope

The receiver of an AnimatedContent's content.

It adds no members to AnimatedVisibilityScope. It exists so that a helper declared as AnimatedContentScope.() -> Unit cannot be passed to an AnimatedVisibility.

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