public class AnimationUtils
extends Object
| java.lang.Object | |
| android.view.animation.AnimationUtils | |
定义用于处理动画的常用工具。
Public constructors |
|
|---|---|
AnimationUtils() |
|
公共方法(Public methods) |
|
|---|---|
static long |
currentAnimationTimeMillis() 以毫秒为单位返回当前动画时间。 |
static Animation |
loadAnimation(Context context, int id) 从资源加载 |
static Interpolator |
loadInterpolator(Context context, int id) 从资源加载 |
static LayoutAnimationController |
loadLayoutAnimation(Context context, int id) 从资源加载 |
static Animation |
makeInAnimation(Context c, boolean fromLeft) 为对象制作动画变得可见。 |
static Animation |
makeInChildBottomAnimation(Context c) 为对象制作动画变得可见。 |
static Animation |
makeOutAnimation(Context c, boolean toRight) 为不可见的对象制作动画。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
long currentAnimationTimeMillis ()
以毫秒为单位返回当前动画时间。 调用setStartTime(long)时应该使用这个时间。 有关不同可用时钟的更多信息,请参阅SystemClock 。 此方法使用的时钟不是 “墙”时钟(它不是currentTimeMillis() )。
| 返回(Returns) | |
|---|---|
long |
the current animation time in milliseconds |
也可以看看:
Animation loadAnimation (Context context, int id)
从资源加载 Animation对象
| 参数(Parameters) | |
|---|---|
context |
Context: Application context used to access resources |
id |
int: The resource id of the animation to load |
| 返回(Returns) | |
|---|---|
Animation |
The animation object reference by the specified id |
| 抛出异常(Throws) | |
|---|---|
Resources.NotFoundException |
when the animation cannot be loaded |
Interpolator loadInterpolator (Context context, int id)
从资源加载 Interpolator对象
| 参数(Parameters) | |
|---|---|
context |
Context: Application context used to access resources |
id |
int: The resource id of the animation to load |
| 返回(Returns) | |
|---|---|
Interpolator |
The animation object reference by the specified id |
| 抛出异常(Throws) | |
|---|---|
Resources.NotFoundException |
|
LayoutAnimationController loadLayoutAnimation (Context context, int id)
从资源加载 LayoutAnimationController对象
| 参数(Parameters) | |
|---|---|
context |
Context: Application context used to access resources |
id |
int: The resource id of the animation to load |
| 返回(Returns) | |
|---|---|
LayoutAnimationController |
The animation object reference by the specified id |
| 抛出异常(Throws) | |
|---|---|
Resources.NotFoundException |
when the layout animation controller cannot be loaded |
Animation makeInAnimation (Context c, boolean fromLeft)
为对象制作动画变得可见。 使用幻灯片和淡入淡出效果。
| 参数(Parameters) | |
|---|---|
c |
Context: Context for loading resources |
fromLeft |
boolean: is the object to be animated coming from the left |
| 返回(Returns) | |
|---|---|
Animation |
The new animation |
Animation makeInChildBottomAnimation (Context c)
为对象制作动画变得可见。 使用幻灯片和淡入淡出效果。
| 参数(Parameters) | |
|---|---|
c |
Context: Context for loading resources |
| 返回(Returns) | |
|---|---|
Animation |
The new animation |
Animation makeOutAnimation (Context c, boolean toRight)
为不可见的对象制作动画。 使用幻灯片和淡入淡出效果。
| 参数(Parameters) | |
|---|---|
c |
Context: Context for loading resources |
toRight |
boolean: is the object to be animated exiting to the right |
| 返回(Returns) | |
|---|---|
Animation |
The new animation |