android.view.animation.ScaleAnimation
An animation that controls the scale of an object. You can specify the point
to use for the center of scaling.
Summary
| |
|
|
Value |
|
| int |
ABSOLUTE |
The specified dimension is an absolute number of pixels. |
0 |
0x00000000 |
| int |
NO_REPEAT |
Don't do anything when the animation ends. |
0 |
0x00000000 |
| int |
RELATIVE_TO_PARENT |
The specified dimension holds a float and should be multiplied by the
height or width of the parent of the object being animated. |
2 |
0x00000002 |
| int |
RELATIVE_TO_SELF |
The specified dimension holds a float and should be multiplied by the
height or width of the object being animated. |
1 |
0x00000001 |
| int |
REPEAT |
Replay the animation from the beginning. |
1 |
0x00000001 |
| int |
REVERSE |
Replay the animation backwards (then forwards again). |
2 |
0x00000002 |
mCycleFlip,
mDurationMillis,
mEnded,
mFillAfter,
mFillBefore,
mInitialized,
mInterpolator,
mListener,
mRepeatMode,
mStartOffsetMillis,
mStartTimeMillis,
mStarted
Public Constructors
| |
|
|
|
|
ScaleAnimation(Context context, AttributeSet attrs) |
| |
|
|
|
|
ScaleAnimation(float fromX, float toX, float fromY, float toY) |
| |
|
|
|
|
ScaleAnimation(float fromX, float toX, float fromY, float toY, float pivotX, float pivotY) |
| |
|
|
|
|
ScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) |
Public Methods
| |
|
|
|
void |
initialize(int width, int height, int parentWidth, int parentHeight) |
Protected Methods
applyTransformation,
ensureInterpolator,
getDuration,
getFillAfter,
getFillBefore,
getInterpolator,
getRepeatMode,
getStartOffset,
getStartTime,
getTransformation,
initialize,
isEnded,
isInitialized,
isStarted,
reset,
resolveSize,
scaleCurrentDuration,
setAnimationListener,
setDuration,
setFillAfter,
setFillBefore,
setInterpolator,
setInterpolator,
setRepeatMode,
setStartOffset,
setStartTime,
start,
startNow,
willChangeTargetViewBounds,
willChangeTransformationMatrix
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
public
ScaleAnimation(Context context, AttributeSet attrs)
Constructor used whan an ScaleAnimation is loaded from a resource.
Parameters
| context
| Application context to use |
| attrs
| Attribute set from which to read values
|
public
ScaleAnimation(float fromX, float toX, float fromY, float toY)
Constructor to use when building a ScaleAnimation from code
Parameters
| fromX
| Horizontal scaling factor to apply at the start of the
animation |
| toX
| Horizontal scaling factor to apply at the end of the animation |
| fromY
| Vertical scaling factor to apply at the start of the
animation |
| toY
| Vertical scaling factor to apply at the end of the animation
|
public
ScaleAnimation(float fromX, float toX, float fromY, float toY, float pivotX, float pivotY)
Constructor to use when building a ScaleAnimation from code
Parameters
| fromX
| Horizontal scaling factor to apply at the start of the
animation |
| toX
| Horizontal scaling factor to apply at the end of the animation |
| fromY
| Vertical scaling factor to apply at the start of the
animation |
| toY
| Vertical scaling factor to apply at the end of the animation |
| pivotX
| 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)
Constructor to use when building a ScaleAnimation from code
Parameters
| fromX
| Horizontal scaling factor to apply at the start of the
animation |
| toX
| Horizontal scaling factor to apply at the end of the animation |
| fromY
| Vertical scaling factor to apply at the start of the
animation |
| toY
| Vertical scaling factor to apply at the end of the animation |
| pivotXType
| 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.
|
Public Methods
public
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. (This is to support animation
sizes being specifed relative to these dimensions.)
Objects that interpret a Animations should call this method when
the sizes of the object being animated and its parent are known, and
before calling getTransformation(long, Transformation).
Parameters
| width
| Width of the object being animated |
| height
| Height of the object being animated |
| parentWidth
| Width of the animated object's parent |
| parentHeight
| Height of the animated object's parent
|
Protected Methods
protected
void
applyTransformation(float interpolatedTime, Transformation t)
Helper for getTransformation. Subclasses should implement this to apply
their transforms given an interpolation value.
Parameters
| interpolatedTime
| The value of the normalized time (0.0 to 1.0)
after it has been run through the interpolation function. |
| t
| The Transofrmation object to fill in with the current
transforms.
|