summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-03-02 17:19:39 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-02 17:19:39 -0800
commitcbf9cb35bb7064f303c6dd9da4485cd5344b6779 (patch)
tree23a9dbc8b984e52e7b8f0194c4d5c6535858764f /core/java/android
parent37b05d7d61cb7e7313736e14ca46c1287c5d1089 (diff)
parentde75cb4738376c4cfe15c56aba7cd78d90e3100e (diff)
Merge "Fix issue #3400119: API to specify a black background behind a window transition"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/animation/Animation.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/core/java/android/view/animation/Animation.java b/core/java/android/view/animation/Animation.java
index 13d0ec198305..87c759c48853 100644
--- a/core/java/android/view/animation/Animation.java
+++ b/core/java/android/view/animation/Animation.java
@@ -181,6 +181,11 @@ public abstract class Animation implements Cloneable {
private int mZAdjustment;
/**
+ * Desired background color behind animation.
+ */
+ private int mBackgroundColor;
+
+ /**
* scalefactor to apply to pivot points, etc. during animation. Subclasses retrieve the
* value via getScaleFactor().
*/
@@ -236,6 +241,8 @@ public abstract class Animation implements Cloneable {
setZAdjustment(a.getInt(com.android.internal.R.styleable.Animation_zAdjustment, ZORDER_NORMAL));
+ setBackgroundColor(a.getInt(com.android.internal.R.styleable.Animation_background, 0));
+
setDetachWallpaper(a.getBoolean(com.android.internal.R.styleable.Animation_detachWallpaper, false));
ensureInterpolator();
@@ -568,6 +575,16 @@ public abstract class Animation implements Cloneable {
}
/**
+ * Set background behind animation.
+ *
+ * @param bg The background color. If 0, no background. Currently must
+ * be black, with any desired alpha level.
+ */
+ public void setBackgroundColor(int bg) {
+ mBackgroundColor = bg;
+ }
+
+ /**
* The scale factor is set by the call to <code>getTransformation</code>. Overrides of
* {@link #getTransformation(long, Transformation, float)} will get this value
* directly. Overrides of {@link #applyTransformation(float, Transformation)} can
@@ -690,6 +707,13 @@ public abstract class Animation implements Cloneable {
}
/**
+ * Returns the background color behind the animation.
+ */
+ public int getBackgroundColor() {
+ return mBackgroundColor;
+ }
+
+ /**
* Return value of {@link #setDetachWallpaper(boolean)}.
* @attr ref android.R.styleable#Animation_detachWallpaper
*/