summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2011-08-29 16:00:23 -0700
committerChet Haase <chet@google.com>2011-09-02 11:28:25 -0700
commit41bff38d3060dbcb55133cedaf5d962c3082efc2 (patch)
tree5e9df9476b02d03ad99c555a8464c4be62ca513e /graphics/java
parentc592e8e61acd3cfbd11f05d2ea59af267ca33dcf (diff)
downloadframeworks_base-41bff38d3060dbcb55133cedaf5d962c3082efc2.zip
frameworks_base-41bff38d3060dbcb55133cedaf5d962c3082efc2.tar.gz
frameworks_base-41bff38d3060dbcb55133cedaf5d962c3082efc2.tar.bz2
Tweaks to NotificationPanel animation
The animation that runs when the NotificationPanel appears used to start, then pause for a long time as the window/surface/layer was created, then by the time it started to be visible, the animation was over. This new approach delays starting the animation until the layer has been drawn, so the animation can actually run a few frames after that before finishing. Change-Id: I998f01fd48cb762178021ad99e2b919b58a1ef3f
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/drawable/ColorDrawable.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/ColorDrawable.java b/graphics/java/android/graphics/drawable/ColorDrawable.java
index 4418e02..88c9155 100644
--- a/graphics/java/android/graphics/drawable/ColorDrawable.java
+++ b/graphics/java/android/graphics/drawable/ColorDrawable.java
@@ -111,8 +111,11 @@ public class ColorDrawable extends Drawable {
alpha += alpha >> 7; // make it 0..256
int baseAlpha = mState.mBaseColor >>> 24;
int useAlpha = baseAlpha * alpha >> 8;
+ int oldUseColor = mState.mUseColor;
mState.mUseColor = (mState.mBaseColor << 8 >>> 8) | (useAlpha << 24);
- invalidateSelf();
+ if (oldUseColor != mState.mUseColor) {
+ invalidateSelf();
+ }
}
/**