AndroidAnimationInterop

Starts Android platform animations for Views mounted in a ViewCompose tree.

Every start function begins the returned animation before returning it. The caller owns that animation and may cancel it or add listeners. These helpers do not participate in ViewCompose state or render transactions; use them only for deliberately platform-specific effects.

Functions

Link copied to clipboard
fun animateToEnd(motionLayout: MotionLayout, durationMillis: Int? = null)

Requests motionLayout to transition to its current transition's end state.

Link copied to clipboard
fun animateToStart(motionLayout: MotionLayout, durationMillis: Int? = null)

Requests motionLayout to transition to its current transition's start state.

Link copied to clipboard
fun animateToState(motionLayout: MotionLayout, endState: Int, durationMillis: Int? = null)

Requests motionLayout to transition to endState.

Link copied to clipboard
fun beginDelayedTransition(targetView: View, transition: Transition? = null): Boolean

Begins a delayed platform transition on targetView or its nearest parent container.

Link copied to clipboard
fun startFlingAnimation(target: View, property: DynamicAnimation.ViewProperty, startVelocity: Float, friction: Float = 1.1f, minValue: Float = -Float.MAX_VALUE, maxValue: Float = Float.MAX_VALUE, onEnd: () -> Unit? = null): FlingAnimation

Creates and immediately starts a bounded fling animation for one View property.

Link copied to clipboard
fun startObjectAnimator(target: View, propertyName: String, vararg values: Float, durationMillis: Long = 300, startDelayMillis: Long = 0, interpolator: TimeInterpolator? = null, onEnd: () -> Unit? = null): ObjectAnimator

Creates and immediately starts an ObjectAnimator for a float View property.

Link copied to clipboard
fun startSpringAnimation(target: View, property: DynamicAnimation.ViewProperty, finalPosition: Float, startVelocity: Float = 0.0f, stiffness: Float = SpringForce.STIFFNESS_MEDIUM, dampingRatio: Float = SpringForce.DAMPING_RATIO_NO_BOUNCY, onEnd: () -> Unit? = null): SpringAnimation

Creates and immediately starts a spring animation for one View property.

Link copied to clipboard
fun startValueAnimator(from: Float, to: Float, durationMillis: Long = 300, startDelayMillis: Long = 0, interpolator: TimeInterpolator? = null, onUpdate: (Float) -> Unit, onEnd: () -> Unit? = null): ValueAnimator

Creates and immediately starts a float ValueAnimator.

Link copied to clipboard
fun startViewPropertyAnimator(target: View, durationMillis: Long = 300, startDelayMillis: Long = 0, interpolator: TimeInterpolator? = null, configure: ViewPropertyAnimator.() -> Unit, onEnd: () -> Unit? = null): ViewPropertyAnimator

Configures and immediately starts target's reusable ViewPropertyAnimator.