From 025e7cb4a186092692e76456e4c4404ab4103fe8 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Wed, 17 Oct 2012 10:15:37 -0400 Subject: [PATCH] Fade out the notification/settings panels just before close. Bug: 7362346 Change-Id: I437a98f4400c0a14b038c268ccf78a322d992681 --- .../statusbar/phone/PhoneStatusBarView.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 1824ba33ab901..af6a14940bdeb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -206,6 +206,20 @@ public class PhoneStatusBarView extends PanelBar { } } + // fade out the panel as it gets buried into the status bar to avoid overdrawing the + // status bar on the last frame of a close animation + final int H = mBar.getStatusBarHeight(); + final float ph = panel.getExpandedHeight() + panel.getPaddingBottom(); + float alpha = 1f; + if (ph < 2*H) { + if (ph < H) alpha = 0f; + else alpha = (ph - H) / H; + alpha = alpha * alpha; // get there faster + } + if (panel.getAlpha() != alpha) { + panel.setAlpha(alpha); + } + mBar.updateCarrierLabelVisibility(false); } }