java.lang.Object | |
↳ | android.animation.Animator |
Known Direct Subclasses |
Known Indirect Subclasses |
This is the superclass for classes which provide basic support for animations which can be
started, ended, and have AnimatorListeners
added to them.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Animator.AnimatorListener | An animation listener receives notifications from an animation. |
||||||||||
Animator.AnimatorPauseListener | A pause listener receives notifications from an animation when the
animation is paused or resumed . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a listener to the set of listeners that are sent events through the life of an
animation, such as start, repeat, and end.
| |||||||||||
Adds a pause listener to this animator.
| |||||||||||
Cancels the animation.
| |||||||||||
Creates and returns a copy of this
Object . | |||||||||||
Ends the animation.
| |||||||||||
Gets the duration of the animation.
| |||||||||||
Returns the timing interpolator that this animation uses.
| |||||||||||
Gets the set of
Animator.AnimatorListener objects that are currently
listening for events on this Animator object. | |||||||||||
The amount of time, in milliseconds, to delay processing the animation
after
start() is called. | |||||||||||
Returns whether this animator is currently in a paused state.
| |||||||||||
Returns whether this Animator is currently running (having been started and gone past any
initial startDelay period and not yet ended).
| |||||||||||
Returns whether this Animator has been started and not yet ended.
| |||||||||||
Pauses a running animation.
| |||||||||||
Removes all
listeners
and pauseListeners from this object. | |||||||||||
Removes a listener from the set listening to this animation.
| |||||||||||
Removes a pause listener from the set listening to this animation.
| |||||||||||
Resumes a paused animation, causing the animator to pick up where it left off
when it was paused.
| |||||||||||
Sets the duration of the animation.
| |||||||||||
The time interpolator used in calculating the elapsed fraction of the
animation.
| |||||||||||
The amount of time, in milliseconds, to delay processing the animation
after
start() is called. | |||||||||||
Sets the target object whose property will be animated by this animation.
| |||||||||||
This method tells the object to use appropriate information to extract
ending values for the animation.
| |||||||||||
This method tells the object to use appropriate information to extract
starting values for the animation.
| |||||||||||
Starts this animation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Adds a listener to the set of listeners that are sent events through the life of an animation, such as start, repeat, and end.
listener | the listener to be added to the current set of listeners for this animation. |
---|
Adds a pause listener to this animator.
listener | the listener to be added to the current set of pause listeners for this animation. |
---|
Cancels the animation. Unlike end()
, cancel()
causes the animation to
stop in its tracks, sending an
onAnimationCancel(Animator)
to
its listeners, followed by an
onAnimationEnd(Animator)
message.
This method must be called on the thread that is running the animation.
Creates and returns a copy of this Object
. The default
implementation returns a so-called "shallow" copy: It creates a new
instance of the same class and then copies the field values (including
object references) from this instance to the new instance. A "deep" copy,
in contrast, would also recursively clone nested objects. A subclass that
needs to implement this kind of cloning should call super.clone()
to create the new instance and then create deep copies of the nested,
mutable objects.
Ends the animation. This causes the animation to assign the end value of the property being
animated, then calling the
onAnimationEnd(Animator)
method on
its listeners.
This method must be called on the thread that is running the animation.
Gets the duration of the animation.
Returns the timing interpolator that this animation uses.
Gets the set of Animator.AnimatorListener
objects that are currently
listening for events on this Animator
object.
The amount of time, in milliseconds, to delay processing the animation
after start()
is called.
Returns whether this Animator is currently running (having been started and gone past any initial startDelay period and not yet ended).
Returns whether this Animator has been started and not yet ended. This state is a superset
of the state of isRunning()
, because an Animator with a nonzero
startDelay
will return true for isStarted()
during the
delay phase, whereas isRunning()
will return true only after the delay phase
is complete.
Removes all listeners
and pauseListeners
from this object.
Removes a listener from the set listening to this animation.
listener | the listener to be removed from the current set of listeners for this animation. |
---|
Removes a pause listener from the set listening to this animation.
listener | the listener to be removed from the current set of pause listeners for this animation. |
---|
Resumes a paused animation, causing the animator to pick up where it left off when it was paused. This method should only be called on the same thread on which the animation was started. Calls to resume() on an animator that is not currently paused will be ignored.
Sets the duration of the animation.
duration | The length of the animation, in milliseconds. |
---|
The time interpolator used in calculating the elapsed fraction of the
animation. The interpolator determines whether the animation runs with
linear or non-linear motion, such as acceleration and deceleration. The
default value is AccelerateDecelerateInterpolator
.
value | the interpolator to be used by this animation |
---|
The amount of time, in milliseconds, to delay processing the animation
after start()
is called.
startDelay | The amount of the delay, in milliseconds |
---|
Sets the target object whose property will be animated by this animation. Not all subclasses
operate on target objects (for example, ValueAnimator
, but this method
is on the superclass for the convenience of dealing generically with those subclasses
that do handle targets.
target | The object being animated |
---|
This method tells the object to use appropriate information to extract ending values for the animation. For example, a AnimatorSet object will pass this call to its child objects to tell them to set up the values. A ObjectAnimator object will use the information it has about its target object and PropertyValuesHolder objects to get the start values for its properties. A ValueAnimator object will ignore the request since it does not have enough information (such as a target object) to gather these values.
This method tells the object to use appropriate information to extract starting values for the animation. For example, a AnimatorSet object will pass this call to its child objects to tell them to set up the values. A ObjectAnimator object will use the information it has about its target object and PropertyValuesHolder objects to get the start values for its properties. A ValueAnimator object will ignore the request since it does not have enough information (such as a target object) to gather these values.
Starts this animation. If the animation has a nonzero startDelay, the animation will start
running after that delay elapses. A non-delayed animation will have its initial
value(s) set immediately, followed by calls to
onAnimationStart(Animator)
for any listeners of this animator.
The animation started by calling this method will be run on the thread that called this method. This thread should have a Looper on it (a runtime exception will be thrown if this is not the case). Also, if the animation will animate properties of objects in the view hierarchy, then the calling thread should be the UI thread for that view hierarchy.