Class

KeyframesSpecBaseConfig

Shared configuration class used as DSL for keyframe based animations.

Source set: Common
public sealed class KeyframesSpecBaseConfig<T, E : KeyframeBaseEntity<T>>

Shared configuration class used as DSL for keyframe based animations.

Properties

durationMillis

Source set: Common
public var durationMillis: Int = DefaultDurationMillis

Duration of the animation in milliseconds. The minimum is 0 and defaults to DefaultDurationMillis

delayMillis

Source set: Common
@get:IntRange(from = 0L) @setparam:IntRange(from = 0L) public var delayMillis: Int = 0

The amount of time that the animation should be delayed. The minimum is 0 and defaults to 0.

Functions

at

Source set: Common
public open infix fun T.at(@IntRange(from = 0) timeStamp: Int): E

Adds a keyframe so that animation value will be this at time: timeStamp. For example:

Parameters

timeStamp The time in the during when animation should reach value: this, with a minimum value of 0.

Return

an instance of E so a custom Easing can be added by the using method.

atFraction

Source set: Common
public open infix fun T.atFraction(@FloatRange(from = 0.0, to = 1.0) fraction: Float): E

Adds a keyframe so that the animation value will be the value specified at a fraction of the total durationMillis set. It's recommended that you always set durationMillis before calling atFraction. For example:

Parameters

fraction The fraction when the animation should reach specified value.

Return

an instance of E so a custom Easing can be added by the using method

using

Source set: Common
public infix fun E.using(easing: Easing): E

Adds an Easing for the interval started with the just provided timestamp. For example: 0f at 50 using LinearEasing

Parameters

easing Easing to be used for the next interval.

Return

the same E instance so that other implementations can expand on the builder pattern

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: