Custom

@Serializable
class Custom(val durationMillis: Int = DEFAULT_ANIMATION_DURATION, val alpha: (Float) -> Float = { 1f }, val scaleX: (Float) -> Float = { 1f }, val scaleY: (Float) -> Float = { 1f }, val translationX: (Float) -> Float = { 0f }, val translationY: (Float) -> Float = { 0f }, val rotationZ: (Float) -> Float = { 0f }) : NavTransition(source)

Fully custom transition using per-frame transform lambdas.

Each lambda receives the animation progress value in [0, 1] and returns the corresponding transform value. Functions that are not overridden use identity defaults (no-op).

Parameters

durationMillis

Total duration of the animation in milliseconds.

alpha

Maps progress → opacity.

scaleX

Maps progress → horizontal scale factor.

scaleY

Maps progress → vertical scale factor.

translationX

Maps progress → horizontal translation in pixels.

translationY

Maps progress → vertical translation in pixels.

rotationZ

Maps progress → rotation around the Z-axis in degrees.

Constructors

Link copied to clipboard
constructor(durationMillis: Int = DEFAULT_ANIMATION_DURATION, alpha: (Float) -> Float = { 1f }, scaleX: (Float) -> Float = { 1f }, scaleY: (Float) -> Float = { 1f }, translationX: (Float) -> Float = { 0f }, translationY: (Float) -> Float = { 0f }, rotationZ: (Float) -> Float = { 0f })

Properties

Link copied to clipboard
@Transient
val alpha: (Float) -> Float
Link copied to clipboard
open override val durationMillis: Int
Link copied to clipboard
@Transient
val rotationZ: (Float) -> Float
Link copied to clipboard
@Transient
val scaleX: (Float) -> Float
Link copied to clipboard
@Transient
val scaleY: (Float) -> Float
Link copied to clipboard
@Transient
val translationX: (Float) -> Float
Link copied to clipboard
@Transient
val translationY: (Float) -> Float

Functions

Link copied to clipboard
fun NavTransition.resolve(screenWidth: Float, screenHeight: Float, isForward: Boolean = true): ResolvedNavTransition

Resolves this NavTransition into a ResolvedNavTransition with concrete per-frame lambdas.