summaryrefslogtreecommitdiffstats
path: root/tests/StatusBar
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-01-19 16:32:22 -0800
committerJoe Onorato <joeo@android.com>2010-01-19 16:32:22 -0800
commitc83bb730ec0333e52990a40edf6d54bb66b1d5ba (patch)
treed64faa280ae393891673278b4d61ec274a8e4259 /tests/StatusBar
parent63ce8e817c9b800b4f08b64c343e533783961b6e (diff)
downloadframeworks_base-c83bb730ec0333e52990a40edf6d54bb66b1d5ba.zip
frameworks_base-c83bb730ec0333e52990a40edf6d54bb66b1d5ba.tar.gz
frameworks_base-c83bb730ec0333e52990a40edf6d54bb66b1d5ba.tar.bz2
Add DateTimeView, a widget that shows a time or the date depending on the
current time. Use that for notifications instead of a TextView that doesn't ever update. BUG 1563917
Diffstat (limited to 'tests/StatusBar')
-rw-r--r--tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
index f2ddd0f..ffc2cbc 100644
--- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
+++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
@@ -121,6 +121,20 @@ public class NotificationTestList extends TestActivity
}
},
+ new Test("Times") {
+ public void run()
+ {
+ long now = System.currentTimeMillis();
+
+ timeNotification(7, "24 hours from now", now+(1000*60*60*24));
+ timeNotification(6, "12:01:00 from now", now+(1000*60*60*12)+(60*1000));
+ timeNotification(5, "12 hours from now", now+(1000*60*60*12));
+ timeNotification(4, "now", now);
+ timeNotification(3, "11:59:00 ago", now-((1000*60*60*12)-(60*1000)));
+ timeNotification(2, "12 hours ago", now-(1000*60*60*12));
+ timeNotification(1, "24 hours ago", now-(1000*60*60*24));
+ }
+ },
new StateStress("Stress - Ongoing / Latest", 100, 100, new Runnable[] {
new Runnable() {
public void run() {
@@ -590,5 +604,12 @@ public class NotificationTestList extends TestActivity
mHandler.postDelayed(mRunnable, mPause);
}
}
+
+ void timeNotification(int n, String label, long time) {
+ mNM.notify(n, new Notification(NotificationTestList.this,
+ R.drawable.ic_statusbar_missedcall, null,
+ time, label, "" + new java.util.Date(time), null));
+
+ }
}