public class AnimationUtils extends Object
Constructor and Description |
---|
AnimationUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
currentAnimationTimeMillis()
Returns the current animation time in milliseconds.
|
static Animation |
loadAnimation(Context context,
int id)
Loads an
Animation object from a resource |
static Interpolator |
loadInterpolator(Context context,
int id)
Loads an
Interpolator object from a resource |
static Interpolator |
loadInterpolator(Resources res,
Resources.Theme theme,
int id)
Loads an
Interpolator object from a resource |
static LayoutAnimationController |
loadLayoutAnimation(Context context,
int id)
Loads a
LayoutAnimationController object from a resource |
static void |
lockAnimationClock(long vsyncMillis) |
static Animation |
makeInAnimation(Context c,
boolean fromLeft)
Make an animation for objects becoming visible.
|
static Animation |
makeInChildBottomAnimation(Context c)
Make an animation for objects becoming visible.
|
static Animation |
makeOutAnimation(Context c,
boolean toRight)
Make an animation for objects becoming invisible.
|
static void |
unlockAnimationClock() |
public static void lockAnimationClock(long vsyncMillis)
public static void unlockAnimationClock()
public static long currentAnimationTimeMillis()
Animation.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 System.currentTimeMillis()
).SystemClock
public static Animation loadAnimation(Context context, @AnimRes int id) throws Resources.NotFoundException
Animation
object from a resourcecontext
- Application context used to access resourcesid
- The resource id of the animation to loadResources.NotFoundException
- when the animation cannot be loadedpublic static LayoutAnimationController loadLayoutAnimation(Context context, @AnimRes int id) throws Resources.NotFoundException
LayoutAnimationController
object from a resourcecontext
- Application context used to access resourcesid
- The resource id of the animation to loadResources.NotFoundException
- when the layout animation controller cannot be loadedpublic static Animation makeInAnimation(Context c, boolean fromLeft)
c
- Context for loading resourcesfromLeft
- is the object to be animated coming from the leftpublic static Animation makeOutAnimation(Context c, boolean toRight)
c
- Context for loading resourcestoRight
- is the object to be animated exiting to the rightpublic static Animation makeInChildBottomAnimation(Context c)
c
- Context for loading resourcespublic static Interpolator loadInterpolator(Context context, @AnimRes @InterpolatorRes int id) throws Resources.NotFoundException
Interpolator
object from a resourcecontext
- Application context used to access resourcesid
- The resource id of the animation to loadResources.NotFoundException
public static Interpolator loadInterpolator(Resources res, Resources.Theme theme, int id) throws Resources.NotFoundException
Interpolator
object from a resourceres
- The resourcesid
- The resource id of the animation to loadResources.NotFoundException