diff --git a/core/api/current.txt b/core/api/current.txt index 9e7bc69152702..967199e685d1b 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -1314,6 +1314,7 @@ package android { field public static final int shouldDisableView = 16843246; // 0x10101ee field public static final int shouldUseDefaultUnfoldTransition = 16844364; // 0x101064c field public static final int showAsAction = 16843481; // 0x10102d9 + field public static final int showBackground; field public static final int showClockAndComplications; field public static final int showDefault = 16843258; // 0x10101fa field public static final int showDividers = 16843561; // 0x1010329 @@ -52454,6 +52455,7 @@ package android.view.animation { method public int getRepeatCount(); method public int getRepeatMode(); method protected float getScaleFactor(); + method public boolean getShowBackground(); method public long getStartOffset(); method public long getStartTime(); method public boolean getTransformation(long, android.view.animation.Transformation); @@ -52479,6 +52481,7 @@ package android.view.animation { method public void setInterpolator(android.view.animation.Interpolator); method public void setRepeatCount(int); method public void setRepeatMode(int); + method public void setShowBackground(boolean); method public void setStartOffset(long); method public void setStartTime(long); method public void setZAdjustment(int); diff --git a/core/java/android/view/animation/Animation.java b/core/java/android/view/animation/Animation.java index b1d618eff40a6..ab749ee284a86 100644 --- a/core/java/android/view/animation/Animation.java +++ b/core/java/android/view/animation/Animation.java @@ -209,6 +209,13 @@ public abstract class Animation implements Cloneable { private boolean mShowWallpaper; private boolean mHasRoundedCorners; + /** + * Whether to show a background behind the windows during the animation. + * @see #getShowBackground() + * @see #setShowBackground(boolean) + */ + private boolean mShowBackground; + private boolean mMore = true; private boolean mOneMoreTime = true; @@ -266,6 +273,8 @@ public abstract class Animation implements Cloneable { a.getBoolean(com.android.internal.R.styleable.Animation_showWallpaper, false)); setHasRoundedCorners( a.getBoolean(com.android.internal.R.styleable.Animation_hasRoundedCorners, false)); + setShowBackground( + a.getBoolean(com.android.internal.R.styleable.Animation_showBackground, false)); final int resID = a.getResourceId(com.android.internal.R.styleable.Animation_interpolator, 0); @@ -697,6 +706,24 @@ public abstract class Animation implements Cloneable { mHasRoundedCorners = hasRoundedCorners; } + /** + * If showBackground 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. + * + * The background comes from the {@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, + * the top most window with showBackground set to {@code true} and a valid background color + * takes precedence. + * + * @param showBackground Whether to show a background behind the windows during the animation. + * @attr ref android.R.styleable#Animation_showBackground + */ + public void setShowBackground(boolean showBackground) { + mShowBackground = showBackground; + } + /** * Gets the acceleration curve type for this animation. * @@ -837,6 +864,24 @@ public abstract class Animation implements Cloneable { return mHasRoundedCorners; } + /** + * If showBackground 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. + * + * The background comes from the {@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, + * the top most window with showBackground set to {@code true} and a valid background color + * takes precedence. + * + * @return if the background of this window should be shown behind the animating windows. + * @attr ref android.R.styleable#Animation_showBackground + */ + public boolean getShowBackground() { + return mShowBackground; + } + /** *

Indicates whether or not this animation will affect the transformation * matrix. For instance, a fade animation will not affect the matrix whereas diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index d2dc6005f3f3a..a08bca3b3fe94 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -6884,6 +6884,9 @@ + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index dfeeccf80423c..e801ac0ba71a6 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -3254,6 +3254,7 @@ +