Added in API level 1

AnimationUtils

open class AnimationUtils
kotlin.Any
   ↳ android.view.animation.AnimationUtils

Defines common utilities for working with animations.

Summary

Public constructors

Public methods
open static Long

Returns the current animation time in milliseconds.

open static Animation!
loadAnimation(context: Context!, id: Int)

Loads an Animation object from a resource

open static Interpolator!
loadInterpolator(context: Context!, id: Int)

Loads an Interpolator object from a resource

open static LayoutAnimationController!
loadLayoutAnimation(context: Context!, id: Int)

Loads a LayoutAnimationController object from a resource

open static Animation!
makeInAnimation(c: Context!, fromLeft: Boolean)

Make an animation for objects becoming visible.

open static Animation!

Make an animation for objects becoming visible.

open static Animation!

Make an animation for objects becoming invisible.

Public constructors

AnimationUtils

AnimationUtils()

Public methods

currentAnimationTimeMillis

Added in API level 1
open static fun currentAnimationTimeMillis(): Long

Returns the current animation time in milliseconds. This time should be used when invoking Animation#setStartTime(long). Refer to android.os.SystemClock for more information about the different available clocks. The clock used by this method is not the "wall" clock (it is not System#currentTimeMillis).

Return
Long the current animation time in milliseconds

loadAnimation

Added in API level 1
open static fun loadAnimation(
    context: Context!,
    id: Int
): Animation!

Loads an Animation object from a resource

Parameters
context Context!: Application context used to access resources
id Int: The resource id of the animation to load
Return
Animation! The animation object referenced by the specified id
Exceptions
android.content.res.Resources.NotFoundException when the animation cannot be loaded

loadInterpolator

Added in API level 1
open static fun loadInterpolator(
    context: Context!,
    id: Int
): Interpolator!

Loads an Interpolator object from a resource

Parameters
context Context!: Application context used to access resources
id Int: The resource id of the animation to load
Return
Interpolator! The interpolator object referenced by the specified id
Exceptions
android.content.res.Resources.NotFoundException

loadLayoutAnimation

Added in API level 1
open static fun loadLayoutAnimation(
    context: Context!,
    id: Int
): LayoutAnimationController!

Loads a LayoutAnimationController object from a resource

Parameters
context Context!: Application context used to access resources
id Int: The resource id of the animation to load
Return
LayoutAnimationController! The animation controller object referenced by the specified id
Exceptions
android.content.res.Resources.NotFoundException when the layout animation controller cannot be loaded

makeInAnimation

Added in API level 1
open static fun makeInAnimation(
    c: Context!,
    fromLeft: Boolean
): Animation!

Make an animation for objects becoming visible. Uses a slide and fade effect.

Parameters
c Context!: Context for loading resources
fromLeft Boolean: is the object to be animated coming from the left
Return
Animation! The new animation

makeInChildBottomAnimation

Added in API level 1
open static fun makeInChildBottomAnimation(c: Context!): Animation!

Make an animation for objects becoming visible. Uses a slide up and fade effect.

Parameters
c Context!: Context for loading resources
Return
Animation! The new animation

makeOutAnimation

Added in API level 1
open static fun makeOutAnimation(
    c: Context!,
    toRight: Boolean
): Animation!

Make an animation for objects becoming invisible. Uses a slide and fade effect.

Parameters
c Context!: Context for loading resources
toRight Boolean: is the object to be animated exiting to the right
Return
Animation! The new animation