AnimatorListeners
added to them.
*/
public abstract class Animator implements Cloneable {
/**
* The set of listeners to be sent events through the life of an animation.
*/
ArrayListThe 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.
* */ public void start() { } /** * Cancels the animation. Unlike {@link #end()},cancel()
causes the animation to
* stop in its tracks, sending an
* {@link android.animation.Animator.AnimatorListener#onAnimationCancel(Animator)} to
* its listeners, followed by an
* {@link android.animation.Animator.AnimatorListener#onAnimationEnd(Animator)} message.
*
* This method must be called on the thread that is running the animation.
*/ public void cancel() { } /** * Ends the animation. This causes the animation to assign the end value of the property being * animated, then calling the * {@link android.animation.Animator.AnimatorListener#onAnimationEnd(Animator)} method on * its listeners. * *This method must be called on the thread that is running the animation.
*/ public void end() { } /** * Pauses a running animation. This method should only be called on the same thread on * which the animation was started. If the animation has not yet been {@link * #isStarted() started} or has since ended, then the call is ignored. Paused * animations can be resumed by calling {@link #resume()}. * * @see #resume() * @see #isPaused() * @see AnimatorPauseListener */ public void pause() { if (isStarted() && !mPaused) { mPaused = true; if (mPauseListeners != null) { ArrayListAnimator
object.
*
* @return ArrayListAn animation listener receives notifications from an animation. * Notifications indicate animation related events, such as the end or the * repetition of the animation.
*/ public static interface AnimatorListener { /** *Notifies the start of the animation.
* * @param animation The started animation. */ void onAnimationStart(Animator animation); /** *Notifies the end of the animation. This callback is not invoked * for animations with repeat count set to INFINITE.
* * @param animation The animation which reached its end. */ void onAnimationEnd(Animator animation); /** *Notifies the cancellation of the animation. This callback is not invoked * for animations with repeat count set to INFINITE.
* * @param animation The animation which was canceled. */ void onAnimationCancel(Animator animation); /** *Notifies the repetition of the animation.
* * @param animation The animation which was repeated. */ void onAnimationRepeat(Animator animation); } /** * A pause listener receives notifications from an animation when the * animation is {@link #pause() paused} or {@link #resume() resumed}. * * @see #addPauseListener(AnimatorPauseListener) */ public static interface AnimatorPauseListener { /** *Notifies that the animation was paused.
* * @param animation The animaton being paused. * @see #pause() */ void onAnimationPause(Animator animation); /** *Notifies that the animation was resumed, after being * previously paused.
* * @param animation The animation being resumed. * @see #resume() */ void onAnimationResume(Animator animation); } /** *Whether or not the Animator is allowed to run asynchronously off of * the UI thread. This is a hint that informs the Animator that it is * OK to run the animation off-thread, however the Animator may decide * that it must run the animation on the UI thread anyway. * *
Regardless of whether or not the animation runs asynchronously, all * listener callbacks will be called on the UI thread.
* *To be able to use this hint the following must be true:
*