Package-level declarations

Types

Link copied to clipboard
typealias AnimationEndListener = () -> Unit
Link copied to clipboard

An empty animation that instantly completes. Useful for replacing dynamic animations with when an animation should conditionally be instant.

Link copied to clipboard

A utility for keeping animations within the scope of a given lifecycleOwner.

Link copied to clipboard
Link copied to clipboard
data class TimeTransition(val startFraction: Double = 0.0, val endFraction: Double = 0.0, val startTimeMs: Long = 0, val endTimeMs: Long = 0)

Contains the time transition information from a start to an end point. This class helps to use the ValueAnimator for animations, see property animation system for more details.

Functions

Link copied to clipboard
fun View.animateVisibility(newVisibility: Int?, enterAnimation: Animation?, exitAnimation: Animation?)

Starts animations based on the View visibility (newVisibility).

Link copied to clipboard
fun View.animateVisibleIf(condition: Boolean?, enterAnimation: Animation?, exitAnimation: Animation?)

Starts animations based on the View visibility. The visibility is based on whether the condition is satisfied.

Link copied to clipboard
fun View.animateVisibleIfNot(condition: Boolean?, enterAnimation: Animation?, exitAnimation: Animation?)

Starts animations based on the View visibility. The visibility is based on whether the condition is satisfied.

Link copied to clipboard
fun View.animateVisibleIfNotNull(instance: Any?, enterAnimation: Animation?, exitAnimation: Animation?)

Starts animations based on the View visibility. The visibility is based on whether the instance is null.

Link copied to clipboard
fun View.animateVisibleIfNull(instance: Any?, enterAnimation: Animation?, exitAnimation: Animation?)

Starts animations based on the View visibility. The visibility is based on whether the instance is null.

Link copied to clipboard

Whether or not the animation scale on the system is set to 0 to make animations instant. This will typically return true during test runs.

Link copied to clipboard

Enables or disables Android's default LayoutTransition to a ViewGroup.

Link copied to clipboard
fun AnimatorSet.playTogether(vararg animatorValues: Pair<Int, Int>, updateListener: (List<Int>) -> Unit)

A helper function to create ValueAnimators for multiple transitions between Int values, play them together, and emit callbacks for each batch of updates. This assumes that this has a duration specified such that all ValueAnimators run for the same amount of time.

fun <T> AnimatorSet.playTogether(animators: Collection<ValueAnimator>, updateListener: (List<T>) -> Unit)

A helper function to play multiple ValueAnimators together and emit callbacks for each batch of updates. This assumes that this has a duration specified such that all ValueAnimators run for the same amount of time, and that all ValueAnimators animate the same type, namely T.

Link copied to clipboard
fun ValueAnimator.update(timeTransition: TimeTransition, vararg values: Any)
fun ValueAnimator.update(timeTransition: TimeTransition, vararg values: Float)
fun ValueAnimator.update(timeTransition: TimeTransition, vararg values: Int)