Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 396a4820 authored by Doris Liu's avatar Doris Liu Committed by Android (Google) Code Review
Browse files

Merge "Refactor AnimatorSet in prep for adding more functionalities"

parents 8b707fbf 1309914e
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -26,6 +26,11 @@ import java.util.ArrayList;
 */
public abstract class Animator implements Cloneable {

    /**
     * The value used to indicate infinite duration (e.g. when Animators repeat infinitely).
     * @hide
     */
    public static final long DURATION_INFINITE = -1;
    /**
     * The set of listeners to be sent events through the life of an animation.
     */
@@ -183,6 +188,16 @@ public abstract class Animator implements Cloneable {
     */
    public abstract long getDuration();

    /**
     * Gets the total duration of the animation, accounting for animation sequences, start delay,
     * and repeating. Return {@link #DURATION_INFINITE} if the duration is infinite.
     * @hide
     * TODO: Unhide
     */
    public long getTotalDuration() {
        return getStartDelay() + getDuration();
    }

    /**
     * The time interpolator used in calculating the elapsed fraction of the
     * animation. The interpolator determines whether the animation runs with
+460 −463

File changed.

Preview size limit exceeded, changes collapsed.

+12 −0
Original line number Diff line number Diff line
@@ -574,6 +574,18 @@ public class ValueAnimator extends Animator {
        return mUnscaledDuration;
    }

    /**
     * @hide
     */
    @Override
    public long getTotalDuration() {
        if (mRepeatCount == INFINITE) {
            return DURATION_INFINITE;
        } else {
            return mUnscaledStartDelay + (mUnscaledDuration * (mRepeatCount + 1));
        }
    }

    /**
     * Sets the position of the animation to the specified point in time. This time should
     * be between 0 and the total duration of the animation, including any repetition. If
+8 −0
Original line number Diff line number Diff line
@@ -336,6 +336,14 @@ public class RenderNodeAnimator extends Animator {
        return mUnscaledDuration;
    }

    /**
     * @hide
     */
    @Override
    public long getTotalDuration() {
        return mUnscaledDuration + mUnscaledStartDelay;
    }

    @Override
    public boolean isRunning() {
        return mState == STATE_DELAYED || mState == STATE_RUNNING;