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

Commit ad88e1b1 authored by George Mount's avatar George Mount
Browse files

API Council: Change docs and constant names.

Bug 16401545

Changed doc for ChangeImageTransform.
Changed IN/OUT to MODE_IN/MODE_OUT.
Changed mode to flag attribute.
Change-Id: Ia2ae9930f9725871c9b1d80b758a3a0808a8f0c6
parent cf068e77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31975,8 +31975,8 @@ package android.transition {
    method public android.animation.Animator onDisappear(android.view.ViewGroup, android.transition.TransitionValues, int, android.transition.TransitionValues, int);
    method public android.animation.Animator onDisappear(android.view.ViewGroup, android.view.View, android.transition.TransitionValues, android.transition.TransitionValues);
    method public void setMode(int);
    field public static final int IN = 1; // 0x1
    field public static final int OUT = 2; // 0x2
    field public static final int MODE_IN = 1; // 0x1
    field public static final int MODE_OUT = 2; // 0x2
  }
  public abstract class VisibilityPropagation extends android.transition.TransitionPropagation {
+7 −27
Original line number Diff line number Diff line
@@ -32,10 +32,12 @@ import android.widget.ImageView;
import java.util.Map;

/**
 * Transitions changes in ImageView {@link ImageView#setScaleType(ImageView.ScaleType)} as
 * well as image scaling due to ImageView size changes. When combined with
 * {@link android.transition.ChangeBounds}, an ImageView that changes size will
 * scale smoothly.
 * This Transition captures an ImageView's matrix before and after the
 * scene change and animates it during the transition.
 *
 * <p>In combination with ChangeBounds, ChangeImageTransform allows ImageViews
 * that change size, shape, or {@link android.widget.ImageView.ScaleType} to animate contents
 * smoothly.</p>
 */
public class ChangeImageTransform extends Transition {

@@ -192,30 +194,8 @@ public class ChangeImageTransform extends Transition {

    private ObjectAnimator createMatrixAnimator(final ImageView imageView, Matrix startMatrix,
            final Matrix endMatrix) {
        ObjectAnimator animator = ObjectAnimator.ofObject(imageView, ANIMATED_TRANSFORM_PROPERTY,
        return ObjectAnimator.ofObject(imageView, ANIMATED_TRANSFORM_PROPERTY,
                new MatrixEvaluator(), startMatrix, endMatrix);
        /*
        AnimatorListenerAdapter listener = new AnimatorListenerAdapter() {
            private Matrix mPausedMatrix;

            @Override
            public void onAnimationPause(Animator animation) {
                if (mPausedMatrix == null) {
                    mPausedMatrix = new Matrix();
                }
                Matrix imageMatrix = imageView.getImageMatrix();
                mPausedMatrix.set(imageMatrix);
                imageView.animateTransform(endMatrix);
            }

            @Override
            public void onAnimationResume(Animator animation) {
                imageView.animateTransform(mPausedMatrix);
            }
        };
        animator.addPauseListener(listener);
        */
        return animator;
    }

    private static class MatrixEvaluator implements TypeEvaluator<Matrix> {
+4 −4
Original line number Diff line number Diff line
@@ -69,17 +69,17 @@ public class Fade extends Visibility {
     * Fading mode used in {@link #Fade(int)} to make the transition
     * operate on targets that are appearing. Maybe be combined with
     * {@link #OUT} to fade both in and out. Equivalent to
     * {@link Visibility#IN}.
     * {@link Visibility#MODE_IN}.
     */
    public static final int IN = Visibility.IN;
    public static final int IN = Visibility.MODE_IN;

    /**
     * Fading mode used in {@link #Fade(int)} to make the transition
     * operate on targets that are disappearing. Maybe be combined with
     * {@link #IN} to fade both in and out. Equivalent to
     * {@link Visibility#OUT}.
     * {@link Visibility#MODE_OUT}.
     */
    public static final int OUT = Visibility.OUT;
    public static final int OUT = Visibility.MODE_OUT;

    /**
     * Constructs a Fade transition that will fade targets in and out.
+11 −11
Original line number Diff line number Diff line
@@ -50,16 +50,16 @@ public abstract class Visibility extends Transition {
    /**
     * Mode used in {@link #setMode(int)} to make the transition
     * operate on targets that are appearing. Maybe be combined with
     * {@link #OUT} to target Visibility changes both in and out.
     * {@link #MODE_OUT} to target Visibility changes both in and out.
     */
    public static final int IN = 0x1;
    public static final int MODE_IN = 0x1;

    /**
     * Mode used in {@link #setMode(int)} to make the transition
     * operate on targets that are disappearing. Maybe be combined with
     * {@link #IN} to target Visibility changes both in and out.
     * {@link #MODE_IN} to target Visibility changes both in and out.
     */
    public static final int OUT = 0x2;
    public static final int MODE_OUT = 0x2;

    private static final String[] sTransitionProperties = {
            PROPNAME_VISIBILITY,
@@ -76,7 +76,7 @@ public abstract class Visibility extends Transition {
        ViewGroup endParent;
    }

    private int mMode = IN | OUT;
    private int mMode = MODE_IN | MODE_OUT;

    private int mForcedStartVisibility = -1;
    private int mForcedEndVisibility = -1;
@@ -98,12 +98,12 @@ public abstract class Visibility extends Transition {
     * on <code>mode</code>.
     *
     * @param mode The behavior supported by this transition, a combination of
     *             {@link #IN} and {@link #OUT}.
     *             {@link #MODE_IN} and {@link #MODE_OUT}.
     * @attr ref android.R.styleable#VisibilityTransition_visibilityMode
     */
    public void setMode(int mode) {
        if ((mode & ~(IN | OUT)) != 0) {
            throw new IllegalArgumentException("Only IN and OUT flags are allowed");
        if ((mode & ~(MODE_IN | MODE_OUT)) != 0) {
            throw new IllegalArgumentException("Only MODE_IN and MODE_OUT flags are allowed");
        }
        mMode = mode;
    }
@@ -112,7 +112,7 @@ public abstract class Visibility extends Transition {
     * Returns whether appearing and/or disappearing Views are supported.
     *
     * Returns whether appearing and/or disappearing Views are supported. A combination of
     *         {@link #IN} and {@link #OUT}.
     *         {@link #MODE_IN} and {@link #MODE_OUT}.
     * @attr ref android.R.styleable#VisibilityTransition_visibilityMode
     */
    public int getMode() {
@@ -276,7 +276,7 @@ public abstract class Visibility extends Transition {
    public Animator onAppear(ViewGroup sceneRoot,
            TransitionValues startValues, int startVisibility,
            TransitionValues endValues, int endVisibility) {
        if ((mMode & IN) != IN || endValues == null) {
        if ((mMode & MODE_IN) != MODE_IN || endValues == null) {
            return null;
        }
        return onAppear(sceneRoot, endValues.view, startValues, endValues);
@@ -339,7 +339,7 @@ public abstract class Visibility extends Transition {
    public Animator onDisappear(ViewGroup sceneRoot,
            TransitionValues startValues, int startVisibility,
            TransitionValues endValues, int endVisibility) {
        if ((mMode & OUT) != OUT) {
        if ((mMode & MODE_OUT) != MODE_OUT) {
            return null;
        }

+2 −4
Original line number Diff line number Diff line
@@ -5468,11 +5468,9 @@
             Corresponds to {@link android.transition.Visibility#setMode(int)}. -->
        <attr name="visibilityMode">
            <!-- Only appearing Views will be supported. -->
            <enum name="mode_in" value="1" />
            <flag name="mode_in" value="1" />
            <!-- Only disappearing Views will be supported. -->
            <enum name="mode_out" value="2" />
            <!-- Both appearing and disappearing views will be supported. -->
            <enum name="mode_in_out" value="3" />
            <flag name="mode_out" value="2" />
        </attr>
    </declare-styleable>
    <!-- Use <code>target</code> as the root tag of the XML resource that