public class AnimationUtils
extends java.lang.Object
| Constructor and Description |
|---|
AnimationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static android.view.animation.Animation |
createHorizontalAnimation(float fromX,
float toX,
long duration,
boolean accelerate) |
static android.view.animation.Animation |
createVerticalAnimation(float fromY,
float toY,
long duration,
boolean accelerate) |
static android.view.animation.Animation |
setAnimationParams(android.view.animation.Animation animation,
long duration,
boolean accelerate)
Sets duration and interpolator for the given Animation object.
|
public static android.view.animation.Animation createVerticalAnimation(float fromY,
float toY,
long duration,
boolean accelerate)
fromY - Change in Y coordinate to apply at the start of the animation, represented as a percentage (where 1.0 is 100%).toY - Change in Y coordinate to apply at the end of the animation, represented as a percentage (where 1.0 is 100%).duration - Amount of time (in milliseconds) for the animation to run.accelerate - Whether to use the accelerate interpolator or the decelerate interpolator.public static android.view.animation.Animation createHorizontalAnimation(float fromX,
float toX,
long duration,
boolean accelerate)
fromX - Change in X coordinate to apply at the start of the animation, represented as a percentage (where 1.0 is 100%).toX - Change in X coordinate to apply at the end of the animation, represented as a percentage (where 1.0 is 100%).duration - Amount of time (in milliseconds) for the animation to run.accelerate - Whether to use the accelerate interpolator or the decelerate interpolator.public static android.view.animation.Animation setAnimationParams(android.view.animation.Animation animation,
long duration,
boolean accelerate)
animation - The Animation object to modify.duration - Amount of time (in milliseconds) for the animation to run.accelerate - Whether to use the accelerate interpolator or the decelerate interpolator.