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

Commit e17bab3a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Re-deprecate animation backgroundColor API" into tm-dev am: c5866bed am: 73f03f9c

parents 6b524dc3 73f03f9c
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -390,6 +390,7 @@ package android {
    field public static final int autoVerify = 16844014; // 0x10104ee
    field public static final int autoVerify = 16844014; // 0x10104ee
    field public static final int autofillHints = 16844118; // 0x1010556
    field public static final int autofillHints = 16844118; // 0x1010556
    field public static final int autofilledHighlight = 16844136; // 0x1010568
    field public static final int autofilledHighlight = 16844136; // 0x1010568
    field public static final int backdropColor;
    field public static final int background = 16842964; // 0x10100d4
    field public static final int background = 16842964; // 0x10100d4
    field public static final int backgroundDimAmount = 16842802; // 0x1010032
    field public static final int backgroundDimAmount = 16842802; // 0x1010032
    field public static final int backgroundDimEnabled = 16843295; // 0x101021f
    field public static final int backgroundDimEnabled = 16843295; // 0x101021f
@@ -1345,7 +1346,7 @@ package android {
    field public static final int shouldDisableView = 16843246; // 0x10101ee
    field public static final int shouldDisableView = 16843246; // 0x10101ee
    field public static final int shouldUseDefaultUnfoldTransition = 16844364; // 0x101064c
    field public static final int shouldUseDefaultUnfoldTransition = 16844364; // 0x101064c
    field public static final int showAsAction = 16843481; // 0x10102d9
    field public static final int showAsAction = 16843481; // 0x10102d9
    field public static final int showBackground;
    field public static final int showBackdrop;
    field public static final int showClockAndComplications;
    field public static final int showClockAndComplications;
    field public static final int showDefault = 16843258; // 0x10101fa
    field public static final int showDefault = 16843258; // 0x10101fa
    field public static final int showDividers = 16843561; // 0x1010329
    field public static final int showDividers = 16843561; // 0x1010329
@@ -52277,7 +52278,8 @@ package android.view.animation {
    method protected android.view.animation.Animation clone() throws java.lang.CloneNotSupportedException;
    method protected android.view.animation.Animation clone() throws java.lang.CloneNotSupportedException;
    method public long computeDurationHint();
    method public long computeDurationHint();
    method protected void ensureInterpolator();
    method protected void ensureInterpolator();
    method @ColorInt public int getBackgroundColor();
    method @ColorInt public int getBackdropColor();
    method @Deprecated @ColorInt public int getBackgroundColor();
    method @Deprecated public boolean getDetachWallpaper();
    method @Deprecated public boolean getDetachWallpaper();
    method public long getDuration();
    method public long getDuration();
    method public boolean getFillAfter();
    method public boolean getFillAfter();
@@ -52286,7 +52288,7 @@ package android.view.animation {
    method public int getRepeatCount();
    method public int getRepeatCount();
    method public int getRepeatMode();
    method public int getRepeatMode();
    method protected float getScaleFactor();
    method protected float getScaleFactor();
    method public boolean getShowBackground();
    method public boolean getShowBackdrop();
    method public long getStartOffset();
    method public long getStartOffset();
    method public long getStartTime();
    method public long getStartTime();
    method public boolean getTransformation(long, android.view.animation.Transformation);
    method public boolean getTransformation(long, android.view.animation.Transformation);
@@ -52302,7 +52304,8 @@ package android.view.animation {
    method public void restrictDuration(long);
    method public void restrictDuration(long);
    method public void scaleCurrentDuration(float);
    method public void scaleCurrentDuration(float);
    method public void setAnimationListener(android.view.animation.Animation.AnimationListener);
    method public void setAnimationListener(android.view.animation.Animation.AnimationListener);
    method public void setBackgroundColor(@ColorInt int);
    method public void setBackdropColor(@ColorInt int);
    method @Deprecated public void setBackgroundColor(@ColorInt int);
    method @Deprecated public void setDetachWallpaper(boolean);
    method @Deprecated public void setDetachWallpaper(boolean);
    method public void setDuration(long);
    method public void setDuration(long);
    method public void setFillAfter(boolean);
    method public void setFillAfter(boolean);
@@ -52312,7 +52315,7 @@ package android.view.animation {
    method public void setInterpolator(android.view.animation.Interpolator);
    method public void setInterpolator(android.view.animation.Interpolator);
    method public void setRepeatCount(int);
    method public void setRepeatCount(int);
    method public void setRepeatMode(int);
    method public void setRepeatMode(int);
    method public void setShowBackground(boolean);
    method public void setShowBackdrop(boolean);
    method public void setStartOffset(long);
    method public void setStartOffset(long);
    method public void setStartTime(long);
    method public void setStartTime(long);
    method public void setZAdjustment(int);
    method public void setZAdjustment(int);
+64 −28
Original line number Original line Diff line number Diff line
@@ -196,9 +196,9 @@ public abstract class Animation implements Cloneable {
    private int mZAdjustment;
    private int mZAdjustment;


    /**
    /**
     * Desired background color behind animation.
     * The desired color of the backdrop to show behind the animation.
     */
     */
    private int mBackgroundColor;
    private int mBackdropColor;


    /**
    /**
     * scalefactor to apply to pivot points, etc. during animation. Subclasses retrieve the
     * scalefactor to apply to pivot points, etc. during animation. Subclasses retrieve the
@@ -211,10 +211,10 @@ public abstract class Animation implements Cloneable {


    /**
    /**
     * Whether to show a background behind the windows during the animation.
     * Whether to show a background behind the windows during the animation.
     * @see #getShowBackground()
     * @see #getShowBackdrop()
     * @see #setShowBackground(boolean)
     * @see #setShowBackdrop(boolean)
     */
     */
    private boolean mShowBackground;
    private boolean mShowBackdrop;


    private boolean mMore = true;
    private boolean mMore = true;
    private boolean mOneMoreTime = true;
    private boolean mOneMoreTime = true;
@@ -265,7 +265,7 @@ public abstract class Animation implements Cloneable {


        setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL));
        setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL));


        setBackgroundColor(a.getInt(com.android.internal.R.styleable.Animation_background, 0));
        setBackdropColor(a.getInt(com.android.internal.R.styleable.Animation_backdropColor, 0));


        setDetachWallpaper(
        setDetachWallpaper(
                a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false));
                a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false));
@@ -273,8 +273,8 @@ public abstract class Animation implements Cloneable {
                a.getBoolean(com.android.internal.R.styleable.Animation_showWallpaper, false));
                a.getBoolean(com.android.internal.R.styleable.Animation_showWallpaper, false));
        setHasRoundedCorners(
        setHasRoundedCorners(
                a.getBoolean(com.android.internal.R.styleable.Animation_hasRoundedCorners, false));
                a.getBoolean(com.android.internal.R.styleable.Animation_hasRoundedCorners, false));
        setShowBackground(
        setShowBackdrop(
                a.getBoolean(com.android.internal.R.styleable.Animation_showBackground, false));
                a.getBoolean(com.android.internal.R.styleable.Animation_showBackdrop, false));


        final int resID = a.getResourceId(com.android.internal.R.styleable.Animation_interpolator, 0);
        final int resID = a.getResourceId(com.android.internal.R.styleable.Animation_interpolator, 0);


@@ -646,9 +646,12 @@ public abstract class Animation implements Cloneable {
     * @param bg The background color.  If 0, no background.  Currently must
     * @param bg The background color.  If 0, no background.  Currently must
     * be black, with any desired alpha level.
     * be black, with any desired alpha level.
     *
     *
     * @deprecated None of window animations are running with background color.
     * @see #setBackdropColor(int) for an alternative.
     */
     */
    @Deprecated
    public void setBackgroundColor(@ColorInt int bg) {
    public void setBackgroundColor(@ColorInt int bg) {
        mBackgroundColor = bg;
        // The background color is not needed any more, do nothing.
    }
    }


    /**
    /**
@@ -705,21 +708,35 @@ public abstract class Animation implements Cloneable {
    }
    }


    /**
    /**
     * If showBackground is {@code true} and this animation is applied on a window, then the windows
     * If showBackdrop is {@code true} and this animation is applied on a window, then the windows
     * in the animation will animate with the background associated with this window behind them.
     * in the animation will animate with the background associated with this window behind them.
     *
     *
     * The background comes from the {@link android.R.styleable#Theme_colorBackground} that is
     * If no backdrop color is explicitly set, the backdrop's color comes from the
     * applied to this window through its theme.
     * {@link android.R.styleable#Theme_colorBackground} that is applied to this window through its
     * theme.
     *
     *
     * If multiple animating windows have showBackground set to {@code true} during an animation,
     * If multiple animating windows have showBackdrop set to {@code true} during an animation,
     * the top most window with showBackground set to {@code true} and a valid background color
     * the top most window with showBackdrop set to {@code true} and a valid background color
     * takes precedence.
     * takes precedence.
     *
     *
     * @param showBackground Whether to show a background behind the windows during the animation.
     * @param showBackdrop Whether to show a background behind the windows during the animation.
     * @attr ref android.R.styleable#Animation_showBackground
     * @attr ref android.R.styleable#Animation_showBackdrop
     */
    public void setShowBackdrop(boolean showBackdrop) {
        mShowBackdrop = showBackdrop;
    }

    /**
     * Set the color to use for the backdrop shown behind the animating windows.
     *
     * Will only show the backdrop if showBackdrop was set to true.
     * See {@link #setShowBackdrop(boolean)}.
     *
     * @param backdropColor The backdrop color. If 0, the backdrop color will not apply.
     * @attr ref android.R.styleable#Animation_backdropColor
     */
     */
    public void setShowBackground(boolean showBackground) {
    public void setBackdropColor(@ColorInt int backdropColor) {
        mShowBackground = showBackground;
        mBackdropColor = backdropColor;
    }
    }


    /**
    /**
@@ -822,10 +839,14 @@ public abstract class Animation implements Cloneable {


    /**
    /**
     * Returns the background color behind the animation.
     * Returns the background color behind the animation.
     *
     * @deprecated None of window animations are running with background color.
     * @see #getBackdropColor() for an alternative.
     */
     */
    @Deprecated
    @ColorInt
    @ColorInt
    public int getBackgroundColor() {
    public int getBackgroundColor() {
        return mBackgroundColor;
        return 0;
    }
    }


    /**
    /**
@@ -869,21 +890,36 @@ public abstract class Animation implements Cloneable {
    }
    }


    /**
    /**
     * If showBackground is {@code true} and this animation is applied on a window, then the windows
     * If showBackdrop is {@code true} and this animation is applied on a window, then the windows
     * in the animation will animate with the background associated with this window behind them.
     * in the animation will animate with the background associated with this window behind them.
     *
     *
     * The background comes from the {@link android.R.styleable#Theme_colorBackground} that is
     * If no backdrop color is explicitly set, the backdrop's color comes from the
     * applied to this window through its theme.
     * {@link android.R.styleable#Theme_colorBackground} that is applied to this window
     * through its theme.
     *
     *
     * If multiple animating windows have showBackground set to {@code true} during an animation,
     * If multiple animating windows have showBackdrop set to {@code true} during an animation,
     * the top most window with showBackground set to {@code true} and a valid background color
     * the top most window with showBackdrop set to {@code true} and a valid background color
     * takes precedence.
     * takes precedence.
     *
     *
     * @return if the background of this window should be shown behind the animating windows.
     * @return if a backdrop should be shown behind the animating windows.
     * @attr ref android.R.styleable#Animation_showBackground
     * @attr ref android.R.styleable#Animation_showBackdrop
     */
    public boolean getShowBackdrop() {
        return mShowBackdrop;
    }

    /**
     * Returns the background color to show behind the animating windows.
     *
     * Will only show the background if showBackdrop was set to true.
     * See {@link #setShowBackdrop(boolean)}.
     *
     * @return The backdrop color. If 0, the backdrop color will not apply.
     * @attr ref android.R.styleable#Animation_backdropColor
     */
     */
    public boolean getShowBackground() {
    @ColorInt
        return mShowBackground;
    public int getBackdropColor() {
        return mBackdropColor;
    }
    }


    /**
    /**
+5 −1
Original line number Original line Diff line number Diff line
@@ -6960,9 +6960,13 @@
        <!-- Special option for window animations: whether window should have rounded corners.
        <!-- Special option for window animations: whether window should have rounded corners.
             @see ScreenDecorationsUtils#getWindowCornerRadius(Resources) -->
             @see ScreenDecorationsUtils#getWindowCornerRadius(Resources) -->
        <attr name="hasRoundedCorners" format="boolean" />
        <attr name="hasRoundedCorners" format="boolean" />
        <!-- Special option for window animations: whether to show a background behind the animating
             windows. By default the window's background is used unless overridden by the
             animation. -->
        <attr name="showBackdrop" format="boolean" />
        <!-- Special option for window animations: whether the window's background should be used as
        <!-- Special option for window animations: whether the window's background should be used as
             a background to the animation. -->
             a background to the animation. -->
        <attr name="showBackground" format="boolean" />
        <attr name="backdropColor" format="color" />
    </declare-styleable>
    </declare-styleable>
    <declare-styleable name="AnimationSet">
    <declare-styleable name="AnimationSet">
+2 −1
Original line number Original line Diff line number Diff line
@@ -126,7 +126,7 @@
    <public name="allowGameDownscaling" />
    <public name="allowGameDownscaling" />
    <public name="allowGameFpsOverride" />
    <public name="allowGameFpsOverride" />
    <public name="localeConfig" />
    <public name="localeConfig" />
    <public name="showBackground" />
    <public name="showBackdrop" />
    <public name="removed_useTargetActivityForQuickAccess"/>
    <public name="removed_useTargetActivityForQuickAccess"/>
    <public name="removed_inheritKeyStoreKeys" />
    <public name="removed_inheritKeyStoreKeys" />
    <public name="preferKeepClear" />
    <public name="preferKeepClear" />
@@ -152,6 +152,7 @@
    <public name="maxDrawableWidth" />
    <public name="maxDrawableWidth" />
    <!-- @hide -->
    <!-- @hide -->
    <public name="maxDrawableHeight" />
    <public name="maxDrawableHeight" />
    <public name="backdropColor" />
  </staging-public-group>
  </staging-public-group>


  <staging-public-group type="id" first-id="0x01de0000">
  <staging-public-group type="id" first-id="0x01de0000">
+3 −3
Original line number Original line Diff line number Diff line
@@ -437,15 +437,15 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
                    cornerRadius = 0;
                    cornerRadius = 0;
                }
                }


                if (a.getShowBackground()) {
                if (a.getShowBackdrop()) {
                    if (info.getAnimationOptions().getBackgroundColor() != 0) {
                    if (info.getAnimationOptions().getBackgroundColor() != 0) {
                        // If available use the background color provided through AnimationOptions
                        // If available use the background color provided through AnimationOptions
                        backgroundColorForTransition =
                        backgroundColorForTransition =
                                info.getAnimationOptions().getBackgroundColor();
                                info.getAnimationOptions().getBackgroundColor();
                    } else if (a.getBackgroundColor() != 0) {
                    } else if (a.getBackdropColor() != 0) {
                        // Otherwise fallback on the background color provided through the animation
                        // Otherwise fallback on the background color provided through the animation
                        // definition.
                        // definition.
                        backgroundColorForTransition = a.getBackgroundColor();
                        backgroundColorForTransition = a.getBackdropColor();
                    } else if (change.getBackgroundColor() != 0) {
                    } else if (change.getBackgroundColor() != 0) {
                        // Otherwise default to the window's background color if provided through
                        // Otherwise default to the window's background color if provided through
                        // the theme as the background color for the animation - the top most window
                        // the theme as the background color for the animation - the top most window
Loading