From 41bff38d3060dbcb55133cedaf5d962c3082efc2 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Mon, 29 Aug 2011 16:00:23 -0700 Subject: 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 --- graphics/java/android/graphics/drawable/ColorDrawable.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'graphics/java') 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(); + } } /** -- cgit v1.1