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

Commit d04215c4 authored by Chet Haase's avatar Chet Haase Committed by Android Git Automerger
Browse files

am 0a41431d: Merge "API and doc cleanup, plus small animation/UI features" into jb-mr2-dev

* commit '0a41431d':
  API and doc cleanup, plus small animation/UI features
parents e4a92e3a 0a41431d
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -2305,22 +2305,28 @@ package android.accounts {
package android.animation {
  public abstract class Animator implements java.lang.Cloneable {
  public abstract interface Animatable {
    method public abstract long getDuration();
    method public abstract android.animation.TimeInterpolator getInterpolator();
    method public abstract long getStartDelay();
    method public abstract android.animation.Animatable setDuration(long);
    method public abstract void setInterpolator(android.animation.TimeInterpolator);
    method public abstract void setStartDelay(long);
  }
  public abstract class Animator implements android.animation.Animatable java.lang.Cloneable {
    ctor public Animator();
    method public void addListener(android.animation.Animator.AnimatorListener);
    method public void cancel();
    method public android.animation.Animator clone();
    method public void end();
    method public abstract long getDuration();
    method public android.animation.TimeInterpolator getInterpolator();
    method public java.util.ArrayList<android.animation.Animator.AnimatorListener> getListeners();
    method public abstract long getStartDelay();
    method public abstract boolean isRunning();
    method public boolean isStarted();
    method public void removeAllListeners();
    method public void removeListener(android.animation.Animator.AnimatorListener);
    method public abstract android.animation.Animator setDuration(long);
    method public abstract void setInterpolator(android.animation.TimeInterpolator);
    method public abstract void setStartDelay(long);
    method public void setTarget(java.lang.Object);
    method public void setupEndValues();
    method public void setupStartValues();
@@ -2511,7 +2517,6 @@ package android.animation {
    method public long getCurrentPlayTime();
    method public long getDuration();
    method public static long getFrameDelay();
    method public android.animation.TimeInterpolator getInterpolator();
    method public int getRepeatCount();
    method public int getRepeatMode();
    method public long getStartDelay();
@@ -25333,6 +25338,7 @@ package android.view {
    method protected float getBottomFadingEdgeStrength();
    method protected int getBottomPaddingOffset();
    method public float getCameraDistance();
    method public android.graphics.Rect getClipBounds();
    method public java.lang.CharSequence getContentDescription();
    method public final android.content.Context getContext();
    method protected android.view.ContextMenu.ContextMenuInfo getContextMenuInfo();
@@ -25587,6 +25593,7 @@ package android.view {
    method public final void setBottom(int);
    method public void setCameraDistance(float);
    method public void setClickable(boolean);
    method public void setClipBounds(android.graphics.Rect);
    method public void setContentDescription(java.lang.CharSequence);
    method public void setDrawingCacheBackgroundColor(int);
    method public void setDrawingCacheEnabled(boolean);
@@ -26012,6 +26019,7 @@ package android.view {
    method public static int getChildMeasureSpec(int, int, int);
    method protected boolean getChildStaticTransformation(android.view.View, android.view.animation.Transformation);
    method public boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
    method public boolean getClipChildren();
    method public int getDescendantFocusability();
    method public android.view.View getFocusedChild();
    method public android.view.animation.LayoutAnimationController getLayoutAnimation();
@@ -26173,6 +26181,7 @@ package android.view {
    method public android.view.ViewPropertyAnimator alphaBy(float);
    method public void cancel();
    method public long getDuration();
    method public android.animation.TimeInterpolator getInterpolator();
    method public long getStartDelay();
    method public android.view.ViewPropertyAnimator rotation(float);
    method public android.view.ViewPropertyAnimator rotationBy(float);
+72 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2013 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.animation;

/**
 * This interface is implemented by animation-related classes that expose
 * the ability to set and get duration, startDelay, and interpolators.
 */
public interface Animatable {

    /**
     * The amount of time, in milliseconds, to delay processing the animation
     * after the animation is started. The {@link #setDuration(long)} of the
     * animation will not begin to elapse until after the startDelay has elapsed.
     *
     * @return the number of milliseconds to delay running the animation
     */
    long getStartDelay();

    /**
     * The amount of time, in milliseconds, to delay processing the animation
     * after the animation is started. The {@link #setDuration(long)} of the
     * animation will not begin to elapse until after the startDelay has elapsed.

     * @param startDelay The amount of the delay, in milliseconds
     */
    void setStartDelay(long startDelay);

    /**
     * Sets the length of the animation.
     *
     * @param duration The length of the animation, in milliseconds.
     */
    Animatable setDuration(long duration);

    /**
     * Gets the duration of the animation.
     *
     * @return The length of the animation, in milliseconds.
     */
    long getDuration();

    /**
     * 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.
     *
     * @param value the interpolator to be used by this animation
     */
    void setInterpolator(TimeInterpolator value);

    /**
     * Returns the timing interpolator that this animation uses.
     *
     * @return The timing interpolator for this animation.
     */
    public TimeInterpolator getInterpolator();
}
+9 −43
Original line number Diff line number Diff line
@@ -22,14 +22,21 @@ import java.util.ArrayList;
 * This is the superclass for classes which provide basic support for animations which can be
 * started, ended, and have <code>AnimatorListeners</code> added to them.
 */
public abstract class Animator implements Cloneable {

public abstract class Animator implements Cloneable, Animatable {

    /**
     * The set of listeners to be sent events through the life of an animation.
     */
    ArrayList<AnimatorListener> mListeners = null;

    @Override
    public abstract Animator setDuration(long duration);

    @Override
    public TimeInterpolator getInterpolator() {
        return null;
    }

    /**
     * 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
@@ -69,47 +76,6 @@ public abstract class Animator implements Cloneable {
    public void end() {
    }

    /**
     * The amount of time, in milliseconds, to delay starting the animation after
     * {@link #start()} is called.
     *
     * @return the number of milliseconds to delay running the animation
     */
    public abstract long getStartDelay();

    /**
     * The amount of time, in milliseconds, to delay starting the animation after
     * {@link #start()} is called.

     * @param startDelay The amount of the delay, in milliseconds
     */
    public abstract void setStartDelay(long startDelay);


    /**
     * Sets the length of the animation.
     *
     * @param duration The length of the animation, in milliseconds.
     */
    public abstract Animator setDuration(long duration);

    /**
     * Gets the length of the animation.
     *
     * @return The length of the animation, in milliseconds.
     */
    public abstract long getDuration();

    /**
     * The time interpolator used in calculating the elapsed fraction of this animation. The
     * interpolator determines whether the animation runs with linear or non-linear motion,
     * such as acceleration and deceleration. The default value is
     * {@link android.view.animation.AccelerateDecelerateInterpolator}
     *
     * @param value the interpolator to be used by this animation
     */
    public abstract void setInterpolator(TimeInterpolator value);

    /**
     * Returns whether this Animator is currently running (having been started and gone past any
     * initial startDelay period and not yet ended).
+26 −5
Original line number Diff line number Diff line
@@ -120,9 +120,19 @@ public final class AnimatorSet extends Animator {
    // set, it is passed along to the child animations.
    private long mDuration = -1;

    // Records the interpolator for the set. Null value indicates that no interpolator
    // was set on this AnimatorSet, so it should not be passed down to the children.
    private TimeInterpolator mInterpolator = null;


    /**
     * Sets up this AnimatorSet to play all of the supplied animations at the same time.
     * This is equivalent to calling {@link #play(Animator)} with the first animator in the
     * set and then {@link Builder#with(Animator)} with each of the other animators. Note that
     * an Animator with a {@link Animator#setStartDelay(long) startDelay} will not actually
     * start until that delay elapses, which means that if the first animator in the list
     * supplied to this constructor has a startDelay, none of the other animators will start
     * until that first animator's startDelay has elapsed.
     *
     * @param items The animations that will be started simultaneously.
     */
@@ -230,15 +240,21 @@ public final class AnimatorSet extends Animator {

    /**
     * Sets the TimeInterpolator for all current {@link #getChildAnimations() child animations}
     * of this AnimatorSet.
     * of this AnimatorSet. The default value is null, which means that no interpolator
     * is set on this AnimatorSet. Setting the interpolator to any non-null value
     * will cause that interpolator to be set on the child animations
     * when the set is started.
     *
     * @param interpolator the interpolator to be used by each child animation of this AnimatorSet
     */
    @Override
    public void setInterpolator(TimeInterpolator interpolator) {
        for (Node node : mNodes) {
            node.animation.setInterpolator(interpolator);
        mInterpolator = interpolator;
    }

    @Override
    public TimeInterpolator getInterpolator() {
        return mInterpolator;
    }

    /**
@@ -459,6 +475,11 @@ public final class AnimatorSet extends Animator {
                // insert "play-after" delays
                node.animation.setDuration(mDuration);
            }
        }
        if (mInterpolator != null) {
            for (Node node : mNodes) {
                node.animation.setInterpolator(mInterpolator);
            }
        }
            // First, sort the nodes (if necessary). This will ensure that sortedNodes
        // contains the animation nodes in the correct order.
+1 −0
Original line number Diff line number Diff line
@@ -853,6 +853,7 @@ public class ValueAnimator extends Animator {
     *
     * @return The timing interpolator for this ValueAnimator.
     */
    @Override
    public TimeInterpolator getInterpolator() {
        return mInterpolator;
    }
Loading