public abstract class Animation
extends java.lang.Object
Animation
Animation in Android| 限定符和类型 | 类和说明 |
|---|---|
static interface |
Animation.AnimationListener
动画监听,包含动画开始和结束时的回调
Animation listener, includes callbacks for animation start and end |
| 限定符和类型 | 字段和说明 |
|---|---|
protected java.lang.String |
animationType
jni使用
For JNI use |
static int |
FILL_MODE_BACKWARDS
动画执行后保持在第一帧
Stay on the first frame after animation execution |
static int |
FILL_MODE_FORWARDS
动画执行后保持在最后一帧
Stay on the last frame after animation execution |
static int |
INFINITE
无限期地重复动画.
|
static int |
RESTART
动画结束后从头播放,最大重复次数受
Animation.setRepeatCount(int) 限制
Play from the beginning after the animation ends, with the maximum repeat count limited by Animation.setRepeatCount(int) |
static int |
REVERSE
动画结束后从尾倒放,最大重复次数受
Animation.setRepeatCount(int) 限制
Play in reverse from the end after the animation ends, with the maximum repeat count limited by Animation.setRepeatCount(int) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getFillMode()
获取动画执行完成后的状态
Get the state after the animation completes |
int |
getRepeatCount()
获取动画重复执行的次数,默认为0。
|
int |
getRepeatMode()
重复执行的模式.
|
void |
setAnimationListener(Animation.AnimationListener listener)
设置动画监听器
Set animation listener |
void |
setDuration(long duration)
设置动画持续时间,如果设置为负数,会修正为0
Set animation duration, if set to a negative value, it will be corrected to 0 |
void |
setFillMode(int fillMode)
设置动画执行完成后的状态
Set the state after the animation completes |
void |
setInterpolator(android.view.animation.Interpolator interpolator)
设置插值器,默认是线性插值器
Set interpolator, default is linear interpolator |
void |
setRepeatCount(int repeatCount)
设置动画重复执行的次数,默认为0
Set the number of times the animation repeats, default is 0 |
void |
setRepeatMode(int repeatMode)
重复执行的模式,默认从前往后执行
Repeat mode, default is forward execution |
public static final int FILL_MODE_FORWARDS
public static final int FILL_MODE_BACKWARDS
public static final int INFINITE
public static final int RESTART
Animation.setRepeatCount(int) 限制
Animation.setRepeatCount(int)public static final int REVERSE
Animation.setRepeatCount(int) 限制
Animation.setRepeatCount(int)protected java.lang.String animationType
public void setAnimationListener(Animation.AnimationListener listener)
listener - 动画监听
public void setDuration(long duration)
duration - 按毫秒计算时间
public void setInterpolator(android.view.animation.Interpolator interpolator)
interpolator - 插值器
public void setFillMode(int fillMode)
fillMode - 默认为保持最后一帧 Animation.FILL_MODE_FORWARDS,缩放动画默认保持第一帧
Animation.FILL_MODE_FORWARDS, scale animation stays on the first frame by defaultpublic int getFillMode()
Animation.FILL_MODE_FORWARDS,缩放动画默认保持第一帧
Animation.FILL_MODE_FORWARDS, scale animation stays on the first frame by defaultpublic void setRepeatCount(int repeatCount)
repeatCount - 动画重复执行的次数,默认不会重复执行
public void setRepeatMode(int repeatMode)
repeatMode - Animation.RESTART or Animation.REVERSEpublic int getRepeatMode()
Animation.REVERSE 或者 Animation.RESTART
Animation.REVERSE or Animation.RESTARTpublic int getRepeatCount()
Animation.INFINITE
Animation.INFINITE