summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-05-03 16:56:20 -0700
committerJeff Brown <jeffbrown@google.com>2012-05-03 17:00:04 -0700
commit6098c1f44b0f2010053f9ebb6d36e01830784fc5 (patch)
treeef23f9ae93b0691e0bf67b28bd448561add406bf /packages/SystemUI
parented5f45ab8f26740f7f12c2ac7b46ad908f3e9ee5 (diff)
downloadframeworks_base-6098c1f44b0f2010053f9ebb6d36e01830784fc5.zip
frameworks_base-6098c1f44b0f2010053f9ebb6d36e01830784fc5.tar.gz
frameworks_base-6098c1f44b0f2010053f9ebb6d36e01830784fc5.tar.bz2
Fix status bar animation jank on last frame.
Change-Id: Idd99f37c76038de1c02a8297c6454c357a846294
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 11ac61c..7abb208 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1254,23 +1254,36 @@ public class PhoneStatusBar extends BaseStatusBar {
if (SPEW) Slog.d(TAG, "doAnimation before mAnimY=" + mAnimY);
incrementAnim(frameTimeNanos);
if (SPEW) Slog.d(TAG, "doAnimation after mAnimY=" + mAnimY);
+
if (mAnimY >= getExpandedViewMaxHeight()-1) {
if (SPEW) Slog.d(TAG, "Animation completed to expanded state.");
mAnimating = false;
updateExpandedViewPos(EXPANDED_FULL_OPEN);
performExpand();
+ return;
}
- else if (mAnimY < getStatusBarHeight()) {
+
+ if (mAnimY == 0 && mAnimAccel == 0 && mAnimVel == 0) {
if (SPEW) Slog.d(TAG, "Animation completed to collapsed state.");
mAnimating = false;
- updateExpandedViewPos(0);
performCollapse();
+ return;
}
- else {
- updateExpandedViewPos((int)mAnimY);
- mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION,
- mAnimationCallback, null);
+
+ if (mAnimY < getStatusBarHeight()) {
+ // Draw one more frame with the bar positioned at the top of the screen
+ // before ending the animation so that the user sees the bar in
+ // its final position. The call to performCollapse() causes a window
+ // relayout which takes time and might cause the animation to skip
+ // on the very last frame before the bar disappears if we did it now.
+ mAnimY = 0;
+ mAnimAccel = 0;
+ mAnimVel = 0;
}
+
+ updateExpandedViewPos((int)mAnimY);
+ mChoreographer.postCallback(Choreographer.CALLBACK_ANIMATION,
+ mAnimationCallback, null);
}
}