public class TranslateAnimation extends Animation
full package
description for details and
sample code.Animation.AnimationListener, Animation.Description
Modifier and Type | Field and Description |
---|---|
protected float |
mFromXDelta |
protected float |
mFromXValue |
protected float |
mFromYDelta |
protected float |
mFromYValue |
protected float |
mToXDelta |
protected float |
mToXValue |
protected float |
mToYDelta |
protected float |
mToYValue |
ABSOLUTE, INFINITE, RELATIVE_TO_PARENT, RELATIVE_TO_SELF, RESTART, REVERSE, START_ON_FIRST_FRAME, ZORDER_BOTTOM, ZORDER_NORMAL, ZORDER_TOP
Constructor and Description |
---|
TranslateAnimation(Context context,
AttributeSet attrs)
Constructor used when a TranslateAnimation is loaded from a resource.
|
TranslateAnimation(float fromXDelta,
float toXDelta,
float fromYDelta,
float toYDelta)
Constructor to use when building a TranslateAnimation from code
|
TranslateAnimation(int fromXType,
float fromXValue,
int toXType,
float toXValue,
int fromYType,
float fromYValue,
int toYType,
float toYValue)
Constructor to use when building a TranslateAnimation from code
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyTransformation(float interpolatedTime,
Transformation t)
Helper for getTransformation.
|
void |
initialize(int width,
int height,
int parentWidth,
int parentHeight)
Initialize this animation with the dimensions of the object being
animated as well as the objects parents.
|
cancel, clone, computeDurationHint, detach, ensureInterpolator, finalize, getBackgroundColor, getDetachWallpaper, getDuration, getFillAfter, getFillBefore, getInterpolator, getInvalidateRegion, getRepeatCount, getRepeatMode, getScaleFactor, getStartOffset, getStartTime, getTransformation, getTransformation, getZAdjustment, hasAlpha, hasEnded, hasStarted, initializeInvalidateRegion, isFillEnabled, isInitialized, reset, resolveSize, restrictDuration, scaleCurrentDuration, setAnimationListener, setBackgroundColor, setDetachWallpaper, setDuration, setFillAfter, setFillBefore, setFillEnabled, setInterpolator, setInterpolator, setListenerHandler, setRepeatCount, setRepeatMode, setStartOffset, setStartTime, setZAdjustment, start, startNow, willChangeBounds, willChangeTransformationMatrix
protected float mFromXValue
protected float mToXValue
protected float mFromYValue
protected float mToYValue
protected float mFromXDelta
protected float mToXDelta
protected float mFromYDelta
protected float mToYDelta
public TranslateAnimation(Context context, AttributeSet attrs)
context
- Application context to useattrs
- Attribute set from which to read valuespublic TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)
fromXDelta
- Change in X coordinate to apply at the start of the
animationtoXDelta
- Change in X coordinate to apply at the end of the
animationfromYDelta
- Change in Y coordinate to apply at the start of the
animationtoYDelta
- Change in Y coordinate to apply at the end of the
animationpublic TranslateAnimation(int fromXType, float fromXValue, int toXType, float toXValue, int fromYType, float fromYValue, int toYType, float toYValue)
fromXType
- Specifies how fromXValue should be interpreted. One of
Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
Animation.RELATIVE_TO_PARENT.fromXValue
- Change in X coordinate to apply at the start of the
animation. This value can either be an absolute number if fromXType
is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.toXType
- Specifies how toXValue should be interpreted. One of
Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
Animation.RELATIVE_TO_PARENT.toXValue
- Change in X coordinate to apply at the end of the
animation. This value can either be an absolute number if toXType
is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.fromYType
- Specifies how fromYValue should be interpreted. One of
Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
Animation.RELATIVE_TO_PARENT.fromYValue
- Change in Y coordinate to apply at the start of the
animation. This value can either be an absolute number if fromYType
is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.toYType
- Specifies how toYValue should be interpreted. One of
Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
Animation.RELATIVE_TO_PARENT.toYValue
- Change in Y coordinate to apply at the end of the
animation. This value can either be an absolute number if toYType
is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.protected void applyTransformation(float interpolatedTime, Transformation t)
Animation
applyTransformation
in class Animation
interpolatedTime
- The value of the normalized time (0.0 to 1.0)
after it has been run through the interpolation function.t
- The Transformation object to fill in with the current
transforms.public void initialize(int width, int height, int parentWidth, int parentHeight)
Animation
Objects that interpret Animations should call this method when
the sizes of the object being animated and its parent are known, and
before calling Animation.getTransformation(long, android.view.animation.Transformation)
.
initialize
in class Animation
width
- Width of the object being animatedheight
- Height of the object being animatedparentWidth
- Width of the animated object's parentparentHeight
- Height of the animated object's parent