From 8cc36e572876f3bb9197f0109db3042466e5f917 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Mon, 17 Oct 2011 14:18:46 -0400 Subject: Auto-close if you swipe away the last notification. Matias, I think this will enchant you. Bug: 4902177 Change-Id: I748b62d3928519455b6b98b0b074a1204e2fdb4b --- .../src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages') 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 b724552..def90f0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -113,6 +113,8 @@ public class PhoneStatusBar extends StatusBar { // will likely move to a resource or other tunable param at some point private static final int INTRUDER_ALERT_DECAY_MS = 10000; + private static final boolean CLOSE_PANEL_WHEN_EMPTIED = true; + // fling gesture tuning parameters, scaled to display density private float mSelfExpandVelocityPx; // classic value: 2000px/s private float mSelfCollapseVelocityPx; // classic value: 2000px/s (will be negated to collapse "up") @@ -695,6 +697,10 @@ public class PhoneStatusBar extends StatusBar { // Recalculate the position of the sliding windows and the titles. updateExpandedViewPos(EXPANDED_LEAVE_ALONE); + + if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0 && !mAnimating) { + animateCollapse(); + } } setAreThereNotifications(); -- cgit v1.1