summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@google.com>2010-12-01 13:53:08 -0500
committerDaniel Sandler <dsandler@google.com>2010-12-01 13:53:08 -0500
commita8e5b060a6ec5a5807f2858eccec835c7b083067 (patch)
tree7bf00498abb26241328189a476c99668f61a1918 /packages
parent0ff18f7cd704370dcb9c979e14b6ac6fb88b29e2 (diff)
downloadframeworks_base-a8e5b060a6ec5a5807f2858eccec835c7b083067.zip
frameworks_base-a8e5b060a6ec5a5807f2858eccec835c7b083067.tar.gz
frameworks_base-a8e5b060a6ec5a5807f2858eccec835c7b083067.tar.bz2
When peeking at a notification, the X will close the window.
Bug: 3241204 Change-Id: Ibc6751062170e85604179da3f01a9c1055a15b1f
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 31311a4..3519e8c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -114,6 +114,7 @@ public class TabletStatusBar extends StatusBar {
NotificationPeekPanel mNotificationPeekWindow;
ViewGroup mNotificationPeekRow;
int mNotificationPeekIndex;
+ IBinder mNotificationPeekKey;
LayoutTransition mNotificationPeekScrubLeft, mNotificationPeekScrubRight;
int mNotificationPeekTapDuration;
@@ -344,9 +345,11 @@ public class TabletStatusBar extends StatusBar {
if (DEBUG) Slog.d(TAG, "opening notification peek window; arg=" + m.arg1);
if (m.arg1 >= 0) {
final int N = mNotns.size();
- if (mNotificationPeekIndex < N) {
+ if (mNotificationPeekIndex >= 0 && mNotificationPeekIndex < N) {
NotificationData.Entry entry = mNotns.get(N-1-mNotificationPeekIndex);
entry.icon.setBackgroundColor(0);
+ mNotificationPeekIndex = -1;
+ mNotificationPeekKey = null;
}
final int peekIndex = m.arg1;
@@ -373,6 +376,7 @@ public class TabletStatusBar extends StatusBar {
mNotificationPanel.setVisibility(View.GONE);
mNotificationPeekIndex = peekIndex;
+ mNotificationPeekKey = entry.key;
}
}
break;
@@ -381,10 +385,13 @@ public class TabletStatusBar extends StatusBar {
mNotificationPeekWindow.setVisibility(View.GONE);
mNotificationPeekRow.removeAllViews();
final int N = mNotns.size();
- if (mNotificationPeekIndex < N) {
+ if (mNotificationPeekIndex >= 0 && mNotificationPeekIndex < N) {
NotificationData.Entry entry = mNotns.get(N-1-mNotificationPeekIndex);
entry.icon.setBackgroundColor(0);
}
+
+ mNotificationPeekIndex = -1;
+ mNotificationPeekKey = null;
break;
case MSG_OPEN_NOTIFICATION_PANEL:
if (DEBUG) Slog.d(TAG, "opening notifications panel");
@@ -814,6 +821,11 @@ public class TabletStatusBar extends StatusBar {
// Remove the expanded view.
ViewGroup rowParent = (ViewGroup)entry.row.getParent();
if (rowParent != null) rowParent.removeView(entry.row);
+
+ if (key == mNotificationPeekKey) {
+ // must close the peek as well, since it's gone
+ mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PEEK);
+ }
// Remove the icon.
// ViewGroup iconParent = (ViewGroup)entry.icon.getParent();
// if (iconParent != null) iconParent.removeView(entry.icon);