AnimatedContentTransitionScope

The receiver of an AnimatedContent's transitionSpec: a segment of the container's transition, plus slides into and out of the container's edges, which need the container's size.

AnimatedContent(
targetState = page,
transitionSpec = {
slideIntoContainer(SlideDirection.Left) togetherWith slideOutOfContainer(SlideDirection.Left)
},
) { Page(it) }

Types

Link copied to clipboard
@Immutable
value class SlideDirection

Which way content travels in slideIntoContainer and out in slideOutOfContainer.

Properties

Link copied to clipboard

Where the container places content inside itself; the AnimatedContent's own parameter.

Link copied to clipboard
abstract val initialState: S

Initial state of a Transition Segment. This is the state that transition starts from.

Link copied to clipboard

An exit transition that keeps the old content composed until the whole transition has finished, instead of removing it when its own exit ends.

Link copied to clipboard
abstract val targetState: S

Target state of a Transition Segment. This is the state that transition will end on.

Functions

Link copied to clipboard
open infix fun S.isTransitioningTo(targetState: S): Boolean

Returns whether the provided state matches the initialState&& the provided targetState matches Segment.targetState.

Link copied to clipboard
abstract fun slideIntoContainer(towards: AnimatedContentTransitionScope.SlideDirection, animationSpec: FiniteAnimationSpec<Point> = spring(visibilityThreshold = pointVisibilityThreshold()), initialOffset: (offsetForFullSlide: Int) -> Int = { it }): EnterTransition

Slides the arriving content in from the container's edge, traveling towards.

Link copied to clipboard
abstract fun slideOutOfContainer(towards: AnimatedContentTransitionScope.SlideDirection, animationSpec: FiniteAnimationSpec<Point> = spring(visibilityThreshold = pointVisibilityThreshold()), targetOffset: (offsetForFullSlide: Int) -> Int = { it }): ExitTransition

Slides the old content out to the container's edge, traveling towards.

Link copied to clipboard
abstract infix fun ContentTransform.using(sizeTransform: SizeTransform?): ContentTransform

Replaces the SizeTransform of this content transform. using null turns off the size animation.