diff --git a/SleepGarmin-watch2/source/AlarmManager.mc b/SleepGarmin-watch2/source/AlarmManager.mc index 46a3fbc..3ccecea 100644 --- a/SleepGarmin-watch2/source/AlarmManager.mc +++ b/SleepGarmin-watch2/source/AlarmManager.mc @@ -9,7 +9,7 @@ class AlarmManager { } function startAlarmNow() { - self.ctx.state.switchToAlarmScreen(); + self.ctx.businessManager.switchToAlarmScreen(); self.ctx.attentionSeeker.startAlarmVibration(); } @@ -28,7 +28,7 @@ class AlarmManager { function stopAlarm() { self.ctx.attentionSeeker.stopAlarmVibration(); - self.ctx.state.backToMainScreen(); + self.ctx.businessManager.backToMainScreen(); } diff --git a/SleepGarmin-watch2/source/BusinessManager.mc b/SleepGarmin-watch2/source/BusinessManager.mc index 2f02e9a..63f86be 100644 --- a/SleepGarmin-watch2/source/BusinessManager.mc +++ b/SleepGarmin-watch2/source/BusinessManager.mc @@ -108,5 +108,13 @@ class BusinessManager { DebugManager.log("BusinessManager exit"); System.exit(); } - + + function switchToAlarmScreen() { + WatchUi.pushView(new AlarmView(self.ctx), new AlarmDelegate(self.ctx), WatchUi.SLIDE_UP); + } + + function backToMainScreen() { + WatchUi.popView(WatchUi.SLIDE_DOWN); + } + } \ No newline at end of file diff --git a/SleepGarmin-watch2/source/State.mc b/SleepGarmin-watch2/source/State.mc index dcb6c89..6fd88b1 100644 --- a/SleepGarmin-watch2/source/State.mc +++ b/SleepGarmin-watch2/source/State.mc @@ -51,12 +51,5 @@ class State { return self.doingAlarm; } - function switchToAlarmScreen() { - WatchUi.pushView(new AlarmView(self.ctx), new AlarmDelegate(self.ctx), WatchUi.SLIDE_UP); - } - - function backToMainScreen() { - WatchUi.popView(WatchUi.SLIDE_DOWN); - } } \ No newline at end of file