slideIntoContainer

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.

Parameters

towards

The direction the entering content moves.

spec

The animation spec for the slide. Defaults to spring.

initialOffset

Maps the container's full-slide extent in pixels to the initial offset. Defaults to a full slide ({ it }).


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).

Parameters

towards

The direction the entering content moves.

duration

How long the slide runs.

initialOffset

Maps the container's full-slide extent in pixels to the initial offset. Defaults to a full slide ({ it }).