Package-level declarations

Types

Link copied to clipboard
interface Animation<T> : Pausable

A running animation produced by an Animator

Link copied to clipboard

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
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

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
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
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.

Link copied to clipboard
@JvmName(name = "keyFramesMulti")
fun <T> keyFrames(converter: MultiDataConverter<T>, duration: Measure<Time>, delay: Measure<Time> = zeroMillis, 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>, delay: Measure<Time> = zeroMillis, 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
fun keyFramesColor(duration: Measure<Time>, delay: Measure<Time> = zeroMillis, frames: KeyFrameBlock<Color>.() -> Unit): FiniteNumericAnimationPlan<Color, Array<Double>>
Link copied to clipboard
fun keyFramesDouble(duration: Measure<Time>, delay: Measure<Time> = zeroMillis, frames: KeyFrameBlock<Double>.() -> Unit): FiniteNumericAnimationPlan<Double, Double>
Link copied to clipboard
fun keyFramesFloat(duration: Measure<Time>, delay: Measure<Time> = zeroMillis, frames: KeyFrameBlock<Float>.() -> Unit): FiniteNumericAnimationPlan<Float, Double>
Link copied to clipboard
fun keyFramesInt(duration: Measure<Time>, delay: Measure<Time> = zeroMillis, frames: KeyFrameBlock<Int>.() -> Unit): FiniteNumericAnimationPlan<Int, Double>
Link copied to clipboard
fun keyFramesPoint(duration: Measure<Time>, delay: Measure<Time> = zeroMillis, frames: KeyFrameBlock<Point>.() -> Unit): FiniteNumericAnimationPlan<Point, Array<Double>>
Link copied to clipboard
Link copied to clipboard
fun keyFramesSize(duration: Measure<Time>, delay: Measure<Time> = zeroMillis, frames: KeyFrameBlock<Size>.() -> Unit): FiniteNumericAnimationPlan<Size, Array<Double>>
Link copied to clipboard
@JvmName(name = "loopMulti")
fun <T> loop(animationPlan: FiniteNumericAnimationPlan<T, Array<Double>>, type: RepetitionType = Restart, delay: Measure<Time> = zeroMillis): NumericAnimationPlan<T, Array<Double>>
@JvmName(name = "loopSingle")
fun <T> loop(animationPlan: FiniteNumericAnimationPlan<T, Double>, type: RepetitionType = Restart, delay: Measure<Time> = zeroMillis): 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, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<T, Array<Double>>
@JvmName(name = "repeatSingle")
fun <T> repeat(animationPlan: FiniteNumericAnimationPlan<T, Double>, times: Int = 1, type: RepetitionType = Restart, delay: Measure<Time> = zeroMillis): 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, delay: Measure<Time> = zeroMillis): 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> = zeroMillis): FiniteNumericAnimationPlan<Measure<T>, Double>

fun <T> tween(converter: SingleDataConverter<T>, easing: EasingFunction, duration: Measure<Time>, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<T, Double>

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

Link copied to clipboard
fun tweenColor(easings: (dimension: Int) -> Easing, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Color, Array<Double>>
fun tweenColor(easing: EasingFunction, duration: Measure<Time>, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Color, Array<Double>>
Link copied to clipboard
fun tweenDouble(easing: EasingFunction, duration: Measure<Time>, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Double, Double>
Link copied to clipboard
fun tweenFloat(easing: EasingFunction, duration: Measure<Time>, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Float, Double>
Link copied to clipboard
fun tweenInt(easing: EasingFunction, duration: Measure<Time>, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Int, Double>
Link copied to clipboard
fun tweenPoint(easings: (dimension: Int) -> Easing, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Point, Array<Double>>
fun tweenPoint(easing: EasingFunction, duration: Measure<Time>, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Point, Array<Double>>
Link copied to clipboard
fun tweenRect(easings: (dimension: Int) -> Easing, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Rectangle, Array<Double>>
Link copied to clipboard
fun tweenSize(easings: (dimension: Int) -> Easing, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Size, Array<Double>>
fun tweenSize(easing: EasingFunction, duration: Measure<Time>, delay: Measure<Time> = zeroMillis): FiniteNumericAnimationPlan<Size, Array<Double>>