|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.animation.Animation
android.view.animation.AnimationSet
public class AnimationSet
Represents a group of Animations that should be played together. The transformation of each individual animation are composed together into a single transform. If AnimationSet sets any properties that its children also set (for example, duration or fillBefore), the values of AnimationSet override the child values.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.view.animation.Animation |
|---|
Animation.AnimationListener, Animation.Description |
| Field Summary |
|---|
| Fields inherited from class android.view.animation.Animation |
|---|
ABSOLUTE, INFINITE, mCycleFlip, mDuration, mEnded, mFillAfter, mFillBefore, mInitialized, mInterpolator, mListener, mRepeatCount, mRepeated, mRepeatMode, mStarted, mStartOffset, mStartTime, RELATIVE_TO_PARENT, RELATIVE_TO_SELF, RESTART, REVERSE, START_ON_FIRST_FRAME, ZORDER_BOTTOM, ZORDER_NORMAL, ZORDER_TOP |
| Constructor Summary | |
|---|---|
AnimationSet(boolean shareInterpolator)
Constructor to use when building an AnimationSet from code |
|
AnimationSet(Context context,
AttributeSet attrs)
Constructor used whan an AnimationSet is loaded from a resource. |
|
| Method Summary | |
|---|---|
void |
addAnimation(Animation a)
Add a child animation to this animation set. |
List<Animation> |
getAnimations()
|
long |
getDuration()
The duration of an AnimationSet is defined to be the duration of the longest child animation. |
long |
getStartTime()
When this animation should start. |
boolean |
getTransformation(long currentTime,
Transformation t)
The transformation of an animation set is the concatenation of all of its component animations. |
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. |
(package private) void |
restoreChildrenStartOffset()
|
void |
restrictDuration(long durationMillis)
Ensure that the duration that this animation will run is not longer than durationMillis. |
(package private) void |
saveChildrenStartOffset(long startOffset)
|
void |
scaleCurrentDuration(float scale)
How much to scale the duration by. |
void |
setDuration(long durationMillis)
Sets the duration of every child animation. |
void |
setFillAfter(boolean fillAfter)
If fillAfter is true, the transformation that this animation performed will persist when it is finished. |
void |
setFillBefore(boolean fillBefore)
If fillBefore is true, this animation will apply its transformation before the start time of the animation. |
void |
setRepeatMode(int repeatMode)
Defines what this animation should do when it reaches the end. |
void |
setStartOffset(long startOffset)
When this animation should start relative to the start time. |
void |
setStartTime(long startTimeMillis)
Sets the start time of this animation and all child animations |
boolean |
willChangeTransformationMatrix()
Indicates whether or not this animation will affect the transformation matrix. |
| Methods inherited from class android.view.animation.Animation |
|---|
applyTransformation, ensureInterpolator, getFillAfter, getFillBefore, getInterpolator, getRepeatCount, getRepeatMode, getStartOffset, getZAdjustment, hasEnded, hasStarted, isInitialized, reset, resolveSize, setAnimationListener, setInterpolator, setInterpolator, setRepeatCount, setZAdjustment, start, startNow, willChangeBounds |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnimationSet(Context context,
AttributeSet attrs)
context - Application context to useattrs - Attribute set from which to read valuespublic AnimationSet(boolean shareInterpolator)
shareInterpolator - Pass true if all of the animations in this set
should use the interpolator assocciated with this AnimationSet.
Pass false if each animation should use its own interpolator.| Method Detail |
|---|
public void setFillAfter(boolean fillAfter)
AnimationAnimationSet to chain
animations. The transformation is not applied before the AnimationSet
itself starts.
setFillAfter in class AnimationfillAfter - true if the animation should apply its transformation after it endspublic void setFillBefore(boolean fillBefore)
AnimationAnimationSet to chain
animations. The transformation is not applied before the AnimationSet
itself starts.
setFillBefore in class AnimationfillBefore - true if the animation should apply its transformation before it startspublic void setRepeatMode(int repeatMode)
AnimationAnimation.INFINITE. Defaults to Animation.RESTART.
setRepeatMode in class AnimationrepeatMode - Animation.RESTART or Animation.REVERSEpublic void setStartOffset(long startOffset)
AnimationAnimationSet
where some of the animations components start at different times.
setStartOffset in class AnimationstartOffset - When this Animation should start, in milliseconds from
the start time of the root AnimationSet.public void setDuration(long durationMillis)
Sets the duration of every child animation.
setDuration in class AnimationdurationMillis - the duration of the animation, in milliseconds, for
every child in this setpublic void addAnimation(Animation a)
a - Animation to add.public void setStartTime(long startTimeMillis)
setStartTime in class AnimationstartTimeMillis - the start time in millisecondsAnimation.setStartTime(long)public long getStartTime()
AnimationAnimation.START_ON_FIRST_FRAME.
getStartTime in class AnimationAnimation.START_ON_FIRST_FRAMEpublic void restrictDuration(long durationMillis)
Animation
restrictDuration in class AnimationdurationMillis - The maximum duration the animation is allowed
to run.public long getDuration()
getDuration in class AnimationAnimation.getDuration()
public boolean getTransformation(long currentTime,
Transformation t)
getTransformation in class AnimationcurrentTime - Where we are in the animation. This is wall clock time.t - A tranformation object that is provided by the
caller and will be filled in by the animation.
Animation.getTransformation(long, android.view.animation.Transformation)public void scaleCurrentDuration(float scale)
Animation
scaleCurrentDuration in class Animationscale - The amount to scale the duration.Animation.scaleCurrentDuration(float)
public void initialize(int width,
int height,
int parentWidth,
int parentHeight)
AnimationObjects that interpret a 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 Animationwidth - 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 parentAnimation.initialize(int, int, int, int)void saveChildrenStartOffset(long startOffset)
startOffset - the startOffset to add to the children's startOffsetvoid restoreChildrenStartOffset()
public List<Animation> getAnimations()
public boolean willChangeTransformationMatrix()
AnimationIndicates whether or not this animation will affect the transformation matrix. For instance, a fade animation will not affect the matrix whereas a scale animation will.
willChangeTransformationMatrix in class Animation
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||