Changeset 299
- Timestamp:
- 08/06/06 16:45:05 (18 years ago)
- Location:
- trunk/hiptop/pester/net/sabi/pester
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hiptop/pester/net/sabi/pester/Alarms.java
r297 r299 189 189 if (e.type == Event.EVENT_TIME_CHANGED) { 190 190 Alarms.getList().forEach(this); 191 ((Pester)Application.getCurrentApp()).resetMidnightCheck(); 191 192 return true; 192 193 } else if (e.type == Event.EVENT_DATASTORE_RESTORED) { -
trunk/hiptop/pester/net/sabi/pester/Pester.java
r296 r299 3 3 import danger.app.Application; 4 4 import danger.app.Event; 5 import danger.internal.Date; 6 import danger.system.Hardware; 5 7 import danger.ui.AlertWindow; 6 8 import danger.ui.Container; … … 17 19 public class Pester extends Application implements Resources, Commands { 18 20 private static ScreenWindow sAlarmListWindow; 21 private static danger.app.Alarm sMidnightAlarm; 19 22 20 23 public Pester() { 21 24 sAlarmListWindow = (ScreenWindow)getResources().getScreen(ID_ALARM_LIST_SCREEN); 22 25 sAlarmListWindow.show(); 26 sMidnightAlarm = new danger.app.Alarm(0, this, null); 27 resetMidnightCheck(); 28 } 29 30 void resetMidnightCheck() { 31 int now = Hardware.getDate(); 32 Date midnight = new Date(); 33 midnight.addDays(1); 34 midnight.setTime(0); 35 sMidnightAlarm.resetWake(midnight.getDangerTimeGMT() - now); 36 DEBUG.p("Pester.resetMidnightCheck"); 23 37 } 24 38 … … 66 80 switch (e.type) { 67 81 case Event.EVENT_ALARM: 82 if (e.argument == null) { // midnight 83 updatePreviewScreen(); 84 // update alarm list 85 sAlarmListWindow.receiveEvent(event(Event.EVENT_TIME_CHANGED, 0)); 86 resetMidnightCheck(); 87 return true; 88 } 68 89 showAlertForAlarm((Alarm)e.argument); 69 90 return true;
Note:
See TracChangeset
for help on using the changeset viewer.