Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

androidx.compose.animation

Classes

AnimatedFloatModel

Model class for AnimatedFloat.

AnimatedValueModel

Model class for AnimatedValue.

ColorPropKey

Built-in property key for Color properties.

DisposableAnimationClock

Clock that remembers all of its active subscriptions so that it can dispose of upstream subscriptions.

DpPropKey

Built-in property key for Dp properties.

EnterTransition

EnterTransition defines how an AnimatedVisibility Composable appears on screen as it becomes visible.

ExitTransition

ExitTransition defines how an AnimatedVisibility Composable disappears on screen as it becomes not visible.

OffsetPropKey

Built-in property key for Offset properties.

PxPropKey

Built-in property key for pixel properties.

RectPropKey

Built-in property key for Rect properties.

Annotations

ExperimentalAnimationApi

Top-level functions summary

Unit
AnimatedVisibility(visible: Boolean, modifier: Modifier = Modifier, enter: EnterTransition = fadeIn() + expandIn(), exit: ExitTransition = shrinkOut() + fadeOut(), initiallyVisible: Boolean = visible, content: () -> Unit)

AnimatedVisibility composable animates the appearance and disappearance of its content, as visible value changes.

Unit
Crossfade(current: T, modifier: Modifier = Modifier, animation: AnimationSpec<Float> = tween(), children: (T) -> Unit)

Crossfade allows to switch between two layouts with a crossfade animation.

Unit
Transition(definition: TransitionDefinition<T>, toState: T, clock: AnimationClockObservable = AnimationClockAmbient.current, initState: T = toState, onStateChangeFinished: (T) -> Unit = null, children: (state: TransitionState) -> Unit)

Deprecated: Transition has been deprecated.

Float
animate(target: Float, animSpec: AnimationSpec<Float> = defaultAnimation, visibilityThreshold: Float = 0.01f, endListener: (Float) -> Unit = null)

Fire-and-forget animation Composable for Float.

Color
animate(target: Color, animSpec: AnimationSpec<Color> = remember { SpringSpec() }, endListener: (Color) -> Unit = null)

Fire-and-forget animation Composable for Color.

Dp
animate(target: Dp, animSpec: AnimationSpec<Dp> = remember { SpringSpec(visibilityThreshold = DpVisibilityThreshold.dp) }, endListener: (Dp) -> Unit = null)

Fire-and-forget animation Composable for Dp.

Position
animate(target: Position, animSpec: AnimationSpec<Position> = remember { SpringSpec( visibilityThreshold = Position(DpVisibilityThreshold.dp, DpVisibilityThreshold.dp) ) }, endListener: (Position) -> Unit = null)

Fire-and-forget animation Composable for Position.

Size
animate(target: Size, animSpec: AnimationSpec<Size> = remember { SpringSpec(visibilityThreshold = Size(PxVisibilityThreshold, PxVisibilityThreshold)) }, endListener: (Size) -> Unit = null)

Fire-and-forget animation Composable for Size.

Bounds
animate(target: Bounds, animSpec: AnimationSpec<Bounds> = remember { SpringSpec( visibilityThreshold = Bounds.VectorConverter.convertFromVector (DpVisibilityThreshold4D) ) }, endListener: (Bounds) -> Unit = null)

Fire-and-forget animation Composable for Bounds.

Offset
animate(target: Offset, animSpec: AnimationSpec<Offset> = remember { SpringSpec(visibilityThreshold = Offset(PxVisibilityThreshold, PxVisibilityThreshold)) }, endListener: (Offset) -> Unit = null)

Fire-and-forget animation Composable for Offset.

Rect
animate(target: Rect, animSpec: AnimationSpec<Rect> = remember { SpringSpec( visibilityThreshold = Rect.VectorConverter.convertFromVector(PxVisibilityThreshold4D) ) }, endListener: (Rect) -> Unit = null)

Fire-and-forget animation Composable for Rect.

PxBounds
animate(target: PxBounds, animSpec: AnimationSpec<PxBounds> = remember { SpringSpec( visibilityThreshold = PxBounds.VectorConverter.convertFromVector(PxVisibilityThreshold4D) ) }, endListener: (PxBounds) -> Unit = null)

Fire-and-forget animation Composable for PxBounds.

Int
animate(target: Int, animSpec: AnimationSpec<Int> = remember { SpringSpec(visibilityThreshold = 1) }, endListener: (Int) -> Unit = null)

Fire-and-forget animation Composable for Int.

IntOffset
animate(target: IntOffset, animSpec: AnimationSpec<IntOffset> = remember { SpringSpec(visibilityThreshold = IntOffset(1, 1)) }, endListener: (IntOffset) -> Unit = null)

Fire-and-forget animation Composable for IntOffset.

IntSize
animate(target: IntSize, animSpec: AnimationSpec<IntSize> = remember { SpringSpec(visibilityThreshold = IntSize(1, 1)) }, endListener: (IntSize) -> Unit = null)

Fire-and-forget animation Composable for IntSize.

T
animate(target: T, animSpec: AnimationSpec<T> = remember { SpringSpec(visibilityThreshold = visibilityThreshold) }, visibilityThreshold: T? = null, endListener: (T) -> Unit = null)

Fire-and-forget animation Composable for AnimationVector.

T
animate(target: T, converter: TwoWayConverter<T, V>, animSpec: AnimationSpec<T> = remember { SpringSpec(visibilityThreshold = visibilityThreshold) }, visibilityThreshold: T? = null, endListener: (T) -> Unit = null)

Fire-and-forget animation Composable for any value.

AnimatedValue<Color, AnimationVector4D>
animatedColor(initVal: Color, clock: AnimationClockObservable = AnimationClockAmbient.current)

The animatedValue effect creates an AnimatedValue of Color and positionally memoizes it.

AnimatedFloat
animatedFloat(initVal: Float, visibilityThreshold: Float = Spring.DefaultDisplacementThreshold, clock: AnimationClockObservable = AnimationClockAmbient.current)

The animatedValue effect creates an AnimatedFloat and positionally memoizes it.

AnimatedValue<T, V>
animatedValue(initVal: T, converter: TwoWayConverter<T, V>, visibilityThreshold: T? = null, clock: AnimationClockObservable = AnimationClockAmbient.current)

The animatedValue effect creates an AnimatedValue and positionally memoizes it.

EnterTransition
expandHorizontally(expandFrom: Alignment.Horizontal = Alignment.End, initialWidth: (fullWidth: Int) -> Int = { 0 }, animSpec: AnimationSpec<IntSize> = spring(), clip: Boolean = true)

This expands the clip bounds of the appearing content horizontally, from the width returned from initialWidth to the full width.

EnterTransition
expandIn(expandFrom: Alignment = Alignment.BottomEnd, initialSize: (fullSize: IntSize) -> IntSize = { IntSize(0, 0) }, animSpec: AnimationSpec<IntSize> = spring(), clip: Boolean = true)

This expands the clip bounds of the appearing content from the size returned from initialSize to the full size.

EnterTransition
expandVertically(expandFrom: Alignment.Vertical = Alignment.Bottom, initialHeight: (fullHeight: Int) -> Int = { 0 }, animSpec: AnimationSpec<IntSize> = spring(), clip: Boolean = true)

This expands the clip bounds of the appearing content vertically, from the height returned from initialHeight to the full height.

EnterTransition
fadeIn(initialAlpha: Float = 0f, animSpec: AnimationSpec<Float> = spring())

This fades in the content of the transition, from the specified starting alpha (i.

ExitTransition
fadeOut(targetAlpha: Float = 0f, animSpec: AnimationSpec<Float> = spring())

This fades out the content of the transition, from full opacity to the specified target alpha (i.

ExitTransition
shrinkHorizontally(shrinkTowards: Alignment.Horizontal = Alignment.End, targetWidth: (fullWidth: Int) -> Int = { 0 }, animSpec: AnimationSpec<IntSize> = spring(), clip: Boolean = true)

This shrinks the clip bounds of the disappearing content horizontally, from the full width to the width returned from targetWidth.

ExitTransition
shrinkOut(shrinkTowards: Alignment = Alignment.BottomEnd, targetSize: (fullSize: IntSize) -> IntSize = { IntSize(0, 0) }, animSpec: AnimationSpec<IntSize> = spring(), clip: Boolean = true)

This shrinks the clip bounds of the disappearing content from the full size to the size returned from targetSize.

ExitTransition
shrinkVertically(shrinkTowards: Alignment.Vertical = Alignment.Bottom, targetHeight: (fullHeight: Int) -> Int = { 0 }, animSpec: AnimationSpec<IntSize> = spring(), clip: Boolean = true)

This shrinks the clip bounds of the disappearing content vertically, from the full height to the height returned from targetHeight.

EnterTransition
slideIn(initialOffset: (fullSize: IntSize) -> IntOffset, animSpec: AnimationSpec<IntOffset> = spring())

This slides in the content of the transition, from a starting offset defined in initialOffset to IntOffset(0, 0).

EnterTransition
slideInHorizontally(initialOffsetX: (fullWidth: Int) -> Int = { -it / 2 }, animSpec: AnimationSpec<IntOffset> = spring())

This slides in the content horizontally, from a starting offset defined in initialOffsetX to 0.

EnterTransition
slideInVertically(initialOffsetY: (fullHeight: Int) ->