to top
Android APIs
public class

AnimationUtils

extends Object
java.lang.Object
   ↳ android.view.animation.AnimationUtils

Class Overview

Defines common utilities for working with animations.

Summary

Public Constructors

? Examples
AnimationUtils()
Public Methods

? Examples
static long currentAnimationTimeMillis()
Returns the current animation time in milliseconds.

? Examples
static Animation loadAnimation( Context context, int id)
Loads an Animation object from a resource

? Examples
static Interpolator loadInterpolator( Context context, int id)
Loads an Interpolator object from a resource

? Examples
static LayoutAnimationController loadLayoutAnimation( Context context, int id)
Loads a LayoutAnimationController object from a resource

? Examples
static Animation makeInAnimation( Context c, boolean fromLeft)
Make an animation for objects becoming visible.

? Examples
static Animation makeInChildBottomAnimation( Context c)
Make an animation for objects becoming visible.

? Examples
static Animation makeOutAnimation( Context c, boolean toRight)
Make an animation for objects becoming invisible.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AnimationUtils ()

Added in API level 1

Public Methods

public static long currentAnimationTimeMillis ()

Added in API level 1

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

Returns
  • the current animation time in milliseconds
See Also

public static Animation loadAnimation (Context context, int id)

Added in API level 1

Loads an Animation object from a resource

Parameters
context Application context used to access resources
id The resource id of the animation to load
Returns
  • The animation object reference by the specified id
Throws
Resources.NotFoundException when the animation cannot be loaded

public static Interpolator loadInterpolator (Context context, int id)

Added in API level 1

Loads an Interpolator object from a resource

Parameters
context Application context used to access resources
id The resource id of the animation to load
Returns
  • The animation object reference by the specified id

public static LayoutAnimationController loadLayoutAnimation (Context context, int id)

Added in API level 1

Loads a LayoutAnimationController object from a resource

Parameters
context Application context used to access resources
id The resource id of the animation to load
Returns
  • The animation object reference by the specified id
Throws
Resources.NotFoundException when the layout animation controller cannot be loaded

public static Animation makeInAnimation (Context c, boolean fromLeft)

Added in API level 1

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

Parameters
c Context for loading resources
fromLeft is the object to be animated coming from the left
Returns
  • The new animation

public static Animation makeInChildBottomAnimation (Context c)

Added in API level 1

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

Parameters
c Context for loading resources
Returns
  • The new animation

public static Animation makeOutAnimation (Context c, boolean toRight)

Added in API level 1

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

Parameters
c Context for loading resources
toRight is the object to be animated exiting to the right
Returns
  • The new animation
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.