diff options
| author | Florian <fgrauper@gmail.com> | 2021-05-20 18:43:54 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-20 18:43:54 (GMT) |
| commit | 13e3463276114dff838fc8fe281754eecfbe9538 (patch) | |
| tree | 55ded8860f26ff7f5f1ffb585d35a252f36f9148 /src/displayapp/screens/Timer.h | |
| parent | 8c3b250dbfe17be61462adc8f84760ce9a648e55 (diff) | |
Timer App (#355)
* built timer app
* Style improvements
* making sure buttons stay hidden when the app is reopened and reappear after the timer runs out
* more sensible calculations of time deltas. eliminated that mysterious scaling factor
* changing the timer icon
Diffstat (limited to 'src/displayapp/screens/Timer.h')
| -rw-r--r-- | src/displayapp/screens/Timer.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/displayapp/screens/Timer.h b/src/displayapp/screens/Timer.h new file mode 100644 index 0000000..0d66f2d --- /dev/null +++ b/src/displayapp/screens/Timer.h @@ -0,0 +1,42 @@ +#pragma once + +#include "Screen.h" +#include "components/datetime/DateTimeController.h" +#include "systemtask/SystemTask.h" +#include "../LittleVgl.h" + +#include "components/timer/TimerController.h" + +namespace Pinetime::Applications::Screens { + + + class Timer : public Screen { + public: + + enum class Modes { + Normal, Done + }; + + Timer(DisplayApp* app, Controllers::TimerController& timerController); + + ~Timer() override; + + bool Refresh() override; + + void setDone(); + + void OnButtonEvent(lv_obj_t* obj, lv_event_t event); + + private: + + bool running; + uint8_t secondsToSet = 0; + uint8_t minutesToSet = 0; + Controllers::TimerController& timerController; + + void createButtons(); + + lv_obj_t* time, * msecTime, * btnPlayPause, * txtPlayPause, * btnMinutesUp, * btnMinutesDown, * btnSecondsUp, * btnSecondsDown, * txtMUp, + * txtMDown, * txtSUp, * txtSDown; + }; +}
\ No newline at end of file |
