diff options
author | Daniel Sandler <dsandler@google.com> | 2010-10-26 16:55:56 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2010-10-29 13:33:24 -0400 |
commit | b0cc50de14dc9e2d0d224803bb523aa7f48904ac (patch) | |
tree | 6c9ce72f96bcb40a5a39ca9720e362715553a37d /tests/StatusBar/src | |
parent | e5bc8f617b48ab237bec22dd4572e678642f25eb (diff) | |
download | frameworks_base-b0cc50de14dc9e2d0d224803bb523aa7f48904ac.zip frameworks_base-b0cc50de14dc9e2d0d224803bb523aa7f48904ac.tar.gz frameworks_base-b0cc50de14dc9e2d0d224803bb523aa7f48904ac.tar.bz2 |
Notification flyovers.
Hold your finger on an individual notification icon to
quickly show that notification's payload.
Also: Quickly swipe up on any icon to open the tray.
Bug: 2994009
Change-Id: I2ae2b546fcfa62994b63b9376f487289b2d06796
Diffstat (limited to 'tests/StatusBar/src')
-rw-r--r-- | tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index 9c267d6..38ee1b8 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -44,6 +44,20 @@ public class NotificationTestList extends TestActivity long mActivityCreateTime = System.currentTimeMillis(); long mChronometerBase = 0; + final int[] kNumberedIconResIDs = { + R.drawable.notification0, + R.drawable.notification1, + R.drawable.notification2, + R.drawable.notification3, + R.drawable.notification4, + R.drawable.notification5, + R.drawable.notification6, + R.drawable.notification7, + R.drawable.notification8, + R.drawable.notification9 + }; + final int kUnnumberedIconResID = R.drawable.notificationx; + @Override protected String tag() { return TAG; @@ -708,7 +722,8 @@ public class NotificationTestList extends TestActivity new Test("Ten Notifications") { public void run() { for (int i = 0; i < 2; i++) { - Notification n = new Notification(NotificationTestList.this, R.drawable.icon2, + Notification n = new Notification(NotificationTestList.this, + kNumberedIconResIDs[i], null, System.currentTimeMillis(), "Persistent #" + i, "Notify me!!!" + i, null); n.flags |= Notification.FLAG_ONGOING_EVENT; @@ -716,7 +731,8 @@ public class NotificationTestList extends TestActivity mNM.notify((i+1)*10, n); } for (int i = 2; i < 10; i++) { - Notification n = new Notification(NotificationTestList.this, R.drawable.icon2, + Notification n = new Notification(NotificationTestList.this, + kNumberedIconResIDs[i], null, System.currentTimeMillis(), "Persistent #" + i, "Notify me!!!" + i, null); n.number = i; @@ -733,6 +749,13 @@ public class NotificationTestList extends TestActivity } }, + new Test("Cancel the other two notifications") { + public void run() { + mNM.cancel(10); + mNM.cancel(100); + } + }, + new Test("Persistent with numbers 1") { public void run() { mNM.notify(1, notificationWithNumbers(1)); @@ -776,8 +799,14 @@ public class NotificationTestList extends TestActivity }; private Notification notificationWithNumbers(int num) { - Notification n = new Notification(this, R.drawable.icon2, null, System.currentTimeMillis(), - "Persistent #2", "Notify me!!!", null); + Notification n = new Notification(this, + (num >= 0 && num < kNumberedIconResIDs.length) + ? kNumberedIconResIDs[num] + : kUnnumberedIconResID, + null, + System.currentTimeMillis(), + "Notification", "Number=" + num, + null); n.number = num; return n; } |