Skip to content

Commit 25e1456

Browse files
dsandlerAndroid (Google) Code Review
authored andcommitted
Merge "Fade out the notification/settings panels just before close." into jb-mr1-dev
2 parents f06125a + 025e7cb commit 25e1456

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,20 @@ public void panelExpansionChanged(PanelView panel, float frac) {
206206
}
207207
}
208208

209+
// fade out the panel as it gets buried into the status bar to avoid overdrawing the
210+
// status bar on the last frame of a close animation
211+
final int H = mBar.getStatusBarHeight();
212+
final float ph = panel.getExpandedHeight() + panel.getPaddingBottom();
213+
float alpha = 1f;
214+
if (ph < 2*H) {
215+
if (ph < H) alpha = 0f;
216+
else alpha = (ph - H) / H;
217+
alpha = alpha * alpha; // get there faster
218+
}
219+
if (panel.getAlpha() != alpha) {
220+
panel.setAlpha(alpha);
221+
}
222+
209223
mBar.updateCarrierLabelVisibility(false);
210224
}
211225
}

0 commit comments

Comments
 (0)