AnimatedContentTransitionScope

Scope for AnimatedContent.transitionSpec. Exposes the initialState and targetState of the current transition (so the spec can vary by direction, e.g. via isTransitioningTo or slideIntoContainer) and collects the enter/exit specs that make up the ContentTransform.

The spec lambda declares the transition by setting enter / exit; anything not set defaults to None. Assigning the same property more than once is last-wins, matching the per-effect merge semantics of EnterTransition.plus.

Properties

Link copied to clipboard

How the target content enters. Last assignment wins; defaults to no enter animation.

Link copied to clipboard

How the outgoing content exits. Last assignment wins; defaults to no exit animation.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
infix fun T.isTransitioningTo(target: T): Boolean

True if this transition is from this value to target.

Link copied to clipboard
fun <T> AnimatedContentTransitionScope<T>.slideIntoContainer(towards: SlideDirection, spec: FiniteAnimationSpec<Float> = spring(), initialOffset: (offsetForFullSlide: Int) -> Int = { it }): EnterTransition

Slides the target content into the container, entering from the edge opposite towards and moving in the towards direction to its resting position. Unlike slideInHorizontally / slideInVertically (which offset by the content's own size), the slide is measured across the container's bounds. Only meaningful inside AnimatedContent's transitionSpec.

fun <T> AnimatedContentTransitionScope<T>.slideIntoContainer(towards: SlideDirection, duration: Duration, initialOffset: (offsetForFullSlide: Int) -> Int = { it }): EnterTransition

Slides the target content into the container over duration — a shortcut for slideIntoContainer(towards, tween(duration), initialOffset).

Link copied to clipboard
fun <T> AnimatedContentTransitionScope<T>.slideOutOfContainer(towards: SlideDirection, spec: FiniteAnimationSpec<Float> = spring(), targetOffset: (offsetForFullSlide: Int) -> Int = { it }): ExitTransition

Slides the outgoing content out of the container in the towards direction. The slide is measured across the container's bounds (see slideIntoContainer). Only meaningful inside AnimatedContent's transitionSpec.

fun <T> AnimatedContentTransitionScope<T>.slideOutOfContainer(towards: SlideDirection, duration: Duration, targetOffset: (offsetForFullSlide: Int) -> Int = { it }): ExitTransition

Slides the outgoing content out of the container over duration — a shortcut for slideOutOfContainer(towards, tween(duration), targetOffset).