From 8c9891840aa26e788750e8b2f12bbbb0bae0f9f3 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Sun, 30 Jan 2011 01:24:09 -0500 Subject: [PATCH] Fix broken intitial notification panel animation. I also tuned the animation parameters a bit to get things to look just a tiny bit smoother. The first run is still jerky but it's not jumping all over the place in the wrong direction. Bug: 3404950 Change-Id: Id10c52f227e6d2db428dc860097023560d154356 --- .../systemui/statusbar/tablet/NotificationPanel.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java index 372aa90410eb6..22fed63a03947 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java @@ -320,7 +320,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, if (mNotificationCount == 0) { end += mContentFrameMissingTranslation; } - start = (y < (HYPERSPACE_OFFRAMP+end)) ? y : (HYPERSPACE_OFFRAMP+end); + start = HYPERSPACE_OFFRAMP+end; } else { start = y; end = y + HYPERSPACE_OFFRAMP; @@ -336,10 +336,15 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, mContentAnim.cancel(); } + Animator fadeAnim = ObjectAnimator.ofFloat(mContentParent, "alpha", + mContentParent.getAlpha(), appearing ? 1.0f : 0.0f); + fadeAnim.setInterpolator(appearing + ? new android.view.animation.AccelerateInterpolator(2.0f) + : new android.view.animation.DecelerateInterpolator(2.0f)); + mContentAnim = new AnimatorSet(); mContentAnim - .play(ObjectAnimator.ofFloat(mContentParent, "alpha", - mContentParent.getAlpha(), appearing ? 1.0f : 0.0f)) + .play(fadeAnim) .with(bgAnim) .with(posAnim) ;