Skip to content

Commit 8cc36e5

Browse files
committed
Auto-close if you swipe away the last notification.
Matias, I think this will enchant you. Bug: 4902177 Change-Id: I748b62d3928519455b6b98b0b074a1204e2fdb4b
1 parent 70ac412 commit 8cc36e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public class PhoneStatusBar extends StatusBar {
113113
// will likely move to a resource or other tunable param at some point
114114
private static final int INTRUDER_ALERT_DECAY_MS = 10000;
115115

116+
private static final boolean CLOSE_PANEL_WHEN_EMPTIED = true;
117+
116118
// fling gesture tuning parameters, scaled to display density
117119
private float mSelfExpandVelocityPx; // classic value: 2000px/s
118120
private float mSelfCollapseVelocityPx; // classic value: 2000px/s (will be negated to collapse "up")
@@ -695,6 +697,10 @@ public void removeNotification(IBinder key) {
695697

696698
// Recalculate the position of the sliding windows and the titles.
697699
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
700+
701+
if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0 && !mAnimating) {
702+
animateCollapse();
703+
}
698704
}
699705

700706
setAreThereNotifications();

0 commit comments

Comments
 (0)