diff options
author | Joe Onorato <joeo@google.com> | 2010-11-20 18:09:34 -0800 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2010-11-21 16:16:28 -0800 |
commit | 561d3858bb9409b999a19f7ba93f0b12e1db835f (patch) | |
tree | c096c7d489c3d73ed8540a202486cc7ed3fdca11 /tests | |
parent | 3f76aa7755fbb2e77ca6a648bbfa1f75680788c9 (diff) | |
download | frameworks_base-561d3858bb9409b999a19f7ba93f0b12e1db835f.zip frameworks_base-561d3858bb9409b999a19f7ba93f0b12e1db835f.tar.gz frameworks_base-561d3858bb9409b999a19f7ba93f0b12e1db835f.tar.bz2 |
The large icon for notifications.
Change-Id: I8537c602b5b5fca03be8980295bfa28330543669
Diffstat (limited to 'tests')
-rw-r--r-- | tests/StatusBar/res/drawable-mdpi/pineapple.png | bin | 0 -> 12574 bytes | |||
-rw-r--r-- | tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java | 58 |
2 files changed, 32 insertions, 26 deletions
diff --git a/tests/StatusBar/res/drawable-mdpi/pineapple.png b/tests/StatusBar/res/drawable-mdpi/pineapple.png Binary files differnew file mode 100644 index 0000000..7377b96 --- /dev/null +++ b/tests/StatusBar/res/drawable-mdpi/pineapple.png diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java b/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java index fddb4d5..3c26212 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationBuilderTest.java @@ -62,57 +62,63 @@ public class NotificationBuilderTest extends TestActivity new Test("Basic Content (1)") { public void run() { int id = 1; + final Notification.Builder b = makeBasicBuilder(this, id); - Notification.Builder b = new Notification.Builder(NotificationBuilderTest.this); + mNM.notify(id, b.getNotification()); + } + }, + + new Test("Content w/ Info (1)") { + public void run() { + int id = 1; + final Notification.Builder b = makeBasicBuilder(this, id); - b.setWhen(System.currentTimeMillis()); - b.setSmallIcon(R.drawable.ic_statusbar_chat); - b.setContentTitle("Title"); - b.setContentText("text\nline2"); - b.setContentIntent(makeContentIntent(id)); - b.setDeleteIntent(makeDeleteIntent(id)); + b.setContentInfo("Snoozed"); mNM.notify(id, b.getNotification()); } }, - new Test("Basic Content w/ Info (1)") { + new Test("w/ Number (1)") { public void run() { int id = 1; + final Notification.Builder b = makeBasicBuilder(this, id); - Notification.Builder b = new Notification.Builder(NotificationBuilderTest.this); - - b.setWhen(System.currentTimeMillis()); - b.setSmallIcon(R.drawable.ic_statusbar_chat); - b.setContentTitle("Title"); - b.setContentText("text\nline2"); - b.setContentIntent(makeContentIntent(id)); - b.setDeleteIntent(makeDeleteIntent(id)); - b.setContentInfo("Snoozed"); + b.setNumber(12345); mNM.notify(id, b.getNotification()); } }, - new Test("Basic Content w/ Number (1)") { + new Test("w/ Number and Large Icon (1)") { public void run() { int id = 1; + final Notification.Builder b = makeBasicBuilder(this, id); - Notification.Builder b = new Notification.Builder(NotificationBuilderTest.this); + b.setNumber(42); - b.setWhen(System.currentTimeMillis()); - b.setSmallIcon(R.drawable.ic_statusbar_chat); - b.setContentTitle("Title"); - b.setContentText("text\nline2"); - b.setContentIntent(makeContentIntent(id)); - b.setDeleteIntent(makeDeleteIntent(id)); - b.setNumber(12345); + final BitmapDrawable bd = (BitmapDrawable)getResources().getDrawable( + R.drawable.pineapple); + b.setLargeIcon(Bitmap.createBitmap(bd.getBitmap())); mNM.notify(id, b.getNotification()); } }, }; + private Notification.Builder makeBasicBuilder(Test t, int id) { + final Notification.Builder b = new Notification.Builder(this); + + b.setWhen(System.currentTimeMillis()); + b.setSmallIcon(R.drawable.ic_statusbar_chat); + b.setContentTitle("Notification builder Test"); + b.setContentText(t.name + "\nhappy notifying"); + b.setContentIntent(makeContentIntent(id)); + b.setDeleteIntent(makeDeleteIntent(id)); + + return b; + } + private PendingIntent makeContentIntent(int id) { Intent intent = new Intent(this, ConfirmationActivity.class); intent.setData(Uri.fromParts("content", "//status_bar_test/content/" + id, null)); |