Package-level declarations

Types

Link copied to clipboard
sealed interface Animation<T> : Pausable

A running animation produced by an Animator

Link copied to clipboard
sealed interface AnimationDataConverter<T, V>

Manages conversion between T and V. This is used by NumericAnimationPlan to support arbitrary types that can be represented numerically.

Link copied to clipboard
interface AnimationPlan<T>

Represents a generic animation of type T.

Link copied to clipboard
sealed interface Animator

Manages a set of AnimationPlans and updates them over time.

Link copied to clipboard
class AnimatorImpl(timer: Timer, animationScheduler: AnimationScheduler) : Animator

Animator implementation that uses a Timer and AnimationScheduler.

Link copied to clipboard
data class Easing(val easing: EasingFunction, val duration: Measure<Time>)

Defines an easing over some duration.

Link copied to clipboard

Represents and animation that runs for a finite amount of time.

Link copied to clipboard
interface KeyFrameBlock<T>

Configuration block used when constructing key-frame animations.

Link copied to clipboard
Link copied to clipboard

Low-level animation for values T that can be converted to numeric values using a AnimationDataConverter. This type is used by higher-level APIs like animation and can be created using tween for tween animations that leverage EasingFunctions.

Link copied to clipboard

Defines the kind of repetition an animation can have

Link copied to clipboard
Link copied to clipboard
class Velocity<T>(val change: T, val over: Measure<Time>)

Defines how quickly T is changing over a period of time

Inherited properties

Link copied to clipboard

Animation converter for a Measure.

Animation converter for Color that allows its red, blue and green components to animate.

Animation converter for Point that allows x and y to animate.

Animation converter for Rectangle that allows x, y, width and height to animate.

Animation converter for Size that allows width and height to animate.

Animation converter for Double.

Animation converter for Float.

Animation converter for Int.

Functions

Link copied to clipboard
@JvmName(name = "afterMulti")
fun <T> after(delay: Measure<Time>, animationPlan: FiniteNumericAnimationPlan<T, Array<Double>>): FiniteNumericAnimationPlan<T, Array<Double>>
@JvmName(name = "afterMulti")
fun <T> after(delay: Measure<Time>, animationPlan: NumericAnimationPlan<T, Array<Double>>): NumericAnimationPlan<T, Array<Double>>

Starts the given animationPlan after a delay.

Link copied to clipboard
fun <V, T> animatingProperty(default: T, animator: Animator, animation: (start: T, end: T) -> AnimationPlan<T>, onChanged: (old: T, new: T) -> Unit = { _,_ -> }): ReadWriteProperty<V, T>

Creates a ReadWriteProperty that will animate to new values.

Link copied to clipboard
fun <T, V> animation(start: T, end: T, animationPlan: NumericAnimationPlan<T, V>, initialVelocity: Velocity<T>? = null): AnimationPlan<T>

Creates an animation based on animationPlan that goes from start to end. This allows the animation of any T that can be animated using a NumericAnimationPlan.

Link copied to clipboard
@JvmName(name = "keyFramesMulti")
fun <T> keyFrames(converter: MultiDataConverter<T>, duration: Measure<Time>, frames: KeyFrameBlock<T>.() -> Unit): FiniteNumericAnimationPlan<T, Array<Double>>
@JvmName(name = "keyFramesMulti")
fun <T> keyFrames(converter: MultiDataConverter<T>, duration: Measure<Time>, delay: Measure<Time>, frames: KeyFrameBlock<T>.() -> Unit): FiniteNumericAnimationPlan<T, Array<Double>>

Creates an animation that manipulates values of type T that are convertable to an array of Double. Each dimension of T will be animated using the definitions within frames.

@JvmName(name = "keyFramesSingle")
fun <T> keyFrames(converter: SingleDataConverter<T>, duration: Measure<Time>, frames: KeyFrameBlock<T>.() -> Unit): FiniteNumericAnimationPlan<T, Double>
@JvmName(name = "keyFramesSingle")
fun <T> keyFrames(converter: SingleDataConverter<T>, duration: Measure<Time>, delay: Measure<Time>, frames: KeyFrameBlock<T>.() -> Unit): FiniteNumericAnimationPlan<T, Double>

Creates an animation that manipulates values of type T that are convertable to a Double.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "loopMulti")
fun <T> loop(animationPlan: FiniteNumericAnimationPlan<T, Array<Double>>, type: RepetitionType = Restart): NumericAnimationPlan<T, Array<Double>>
@JvmName(name = "loopSingle")
fun <T> loop(animationPlan: FiniteNumericAnimationPlan<T, Double>, type: RepetitionType = Restart): NumericAnimationPlan<T, Double>
@JvmName(name = "loopMulti")
fun <T> loop(animationPlan: FiniteNumericAnimationPlan<T, Array<Double>>, type: RepetitionType = Restart, delay: Measure<Time>): NumericAnimationPlan<T, Array<Double>>
@JvmName(name = "loopSingle")
fun <T> loop(animationPlan: FiniteNumericAnimationPlan<T, Double>, type: RepetitionType = Restart, delay: Measure<Time>): NumericAnimationPlan<T, Double>

Loops the given animationPlan indefinitely.

Link copied to clipboard
@JvmName(name = "repeatMulti")
fun <T> repeat(animationPlan: FiniteNumericAnimationPlan<T, Array<Double>>, times: Int = 1, type: RepetitionType = Restart): FiniteNumericAnimationPlan<T, Array<Double>>
@JvmName(name = "repeatSingle")
fun <T> repeat(animationPlan: FiniteNumericAnimationPlan<T, Double>, times: Int = 1, type: RepetitionType = Restart): FiniteNumericAnimationPlan<T, Double>
@JvmName(name = "repeatMulti")
fun <T> repeat(animationPlan: FiniteNumericAnimationPlan<T, Array<Double>>, times: Int = 1, type: RepetitionType = Restart, delay: Measure<Time>): FiniteNumericAnimationPlan<T, Array<Double>>
@JvmName(name = "repeatSingle")
fun <T> repeat(animationPlan: FiniteNumericAnimationPlan<T, Double>, times: Int = 1, type: RepetitionType = Restart, delay: Measure<Time>): FiniteNumericAnimationPlan<T, Double>

Repeats the given animationPlan for the specified number of times.

Link copied to clipboard
fun <T> tween(converter: MultiDataConverter<T>, easings: (dimension: Int) -> Easing): FiniteNumericAnimationPlan<T, Array<Double>>
fun <T> tween(converter: MultiDataConverter<T>, easings: (dimension: Int) -> Easing, delay: Measure<Time>): FiniteNumericAnimationPlan<T, Array<Double>>

Creates an animation that manipulates values of type T that are convertable to an array of Double. Each dimension of T will be animated using a Easing returned by the easings function.

fun <T : Units> tween(units: T, easing: EasingFunction, duration: Measure<Time>, delay: Measure<Time>): FiniteNumericAnimationPlan<Measure<T>, Double>

Creates an animation that manipulates values of type T that are convertable to Double.

Link copied to clipboard
@JvmName(name = "tweenColorDeprecated")
fun tweenColor(easings: (dimension: Int) -> Easing, delay: Measure<Time>): FiniteNumericAnimationPlan<Color, Array<Double>>
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "tweenPointDeprecated")
fun tweenPoint(easings: (dimension: Int) -> Easing, delay: Measure<Time>): FiniteNumericAnimationPlan<Point, Array<Double>>
Link copied to clipboard
Link copied to clipboard
fun tweenSize(easings: (dimension: Int) -> Easing): FiniteNumericAnimationPlan<Size, Array<Double>>
@JvmName(name = "tweenSizeDeprecated")
fun tweenSize(easings: (dimension: Int) -> Easing, delay: Measure<Time>): FiniteNumericAnimationPlan<Size, Array<Double>>

Inherited functions

Link copied to clipboard
operator fun <V, T, K> Animator.invoke(default: T, using: NumericAnimationPlan<T, K>, onChanged: (old: T, new: T) -> Unit = { _,_ -> }): ReadWriteProperty<V, T>

Defines a property that can be animated using the given animation.

operator fun <T, V> Animator.invoke(range: Pair<T, T>, using: NumericAnimationPlan<T, V>, onChanged: (T) -> Unit): Animation<T>

Starts an animation from range.first to range.second.