Animation.AnimationListener, Animation.Description
ABSOLUTE, INFINITE, RELATIVE_TO_PARENT, RELATIVE_TO_SELF, RESTART, REVERSE, START_ON_FIRST_FRAME, ZORDER_BOTTOM, ZORDER_NORMAL, ZORDER_TOP
Constructor and Description |
---|
ScaleAnimation(Context context,
AttributeSet attrs)
Constructor used when a ScaleAnimation is loaded from a resource.
|
ScaleAnimation(float fromX,
float toX,
float fromY,
float toY)
Constructor to use when building a ScaleAnimation from code
|
ScaleAnimation(float fromX,
float toX,
float fromY,
float toY,
float pivotX,
float pivotY)
Constructor to use when building a ScaleAnimation from code
|
ScaleAnimation(float fromX,
float toX,
float fromY,
float toY,
int pivotXType,
float pivotXValue,
int pivotYType,
float pivotYValue)
Constructor to use when building a ScaleAnimation 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
public ScaleAnimation(Context context, AttributeSet attrs)
context
- Application context to useattrs
- Attribute set from which to read valuespublic ScaleAnimation(float fromX, float toX, float fromY, float toY)
fromX
- Horizontal scaling factor to apply at the start of the
animationtoX
- Horizontal scaling factor to apply at the end of the animationfromY
- Vertical scaling factor to apply at the start of the
animationtoY
- Vertical scaling factor to apply at the end of the animationpublic ScaleAnimation(float fromX, float toX, float fromY, float toY, float pivotX, float pivotY)
fromX
- Horizontal scaling factor to apply at the start of the
animationtoX
- Horizontal scaling factor to apply at the end of the animationfromY
- Vertical scaling factor to apply at the start of the
animationtoY
- Vertical scaling factor to apply at the end of the animationpivotX
- The X coordinate of the point about which the object is
being scaled, specified as an absolute number where 0 is the left
edge. (This point remains fixed while the object changes size.)pivotY
- The Y coordinate of the point about which the object is
being scaled, specified as an absolute number where 0 is the top
edge. (This point remains fixed while the object changes size.)public ScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
fromX
- Horizontal scaling factor to apply at the start of the
animationtoX
- Horizontal scaling factor to apply at the end of the animationfromY
- Vertical scaling factor to apply at the start of the
animationtoY
- Vertical scaling factor to apply at the end of the animationpivotXType
- Specifies how pivotXValue should be interpreted. One of
Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
Animation.RELATIVE_TO_PARENT.pivotXValue
- The X coordinate of the point about which the object
is being scaled, specified as an absolute number where 0 is the
left edge. (This point remains fixed while the object changes
size.) This value can either be an absolute number if pivotXType
is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.pivotYType
- Specifies how pivotYValue should be interpreted. One of
Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF, or
Animation.RELATIVE_TO_PARENT.pivotYValue
- The Y coordinate of the point about which the object
is being scaled, specified as an absolute number where 0 is the
top edge. (This point remains fixed while the object changes
size.) This value can either be an absolute number if pivotYType
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