2021-05-20 14:43:54 -04:00
|
|
|
#pragma once
|
|
|
|
|
2021-10-13 16:08:35 -04:00
|
|
|
#include "displayapp/screens/Screen.h"
|
2021-05-20 14:43:54 -04:00
|
|
|
#include "components/datetime/DateTimeController.h"
|
|
|
|
#include "systemtask/SystemTask.h"
|
2021-10-13 16:08:35 -04:00
|
|
|
#include "displayapp/LittleVgl.h"
|
2022-05-13 14:35:05 -04:00
|
|
|
#include "displayapp/widgets/Counter.h"
|
2021-05-20 14:43:54 -04:00
|
|
|
|
|
|
|
#include "components/timer/TimerController.h"
|
|
|
|
|
|
|
|
namespace Pinetime::Applications::Screens {
|
|
|
|
class Timer : public Screen {
|
|
|
|
public:
|
2021-07-19 09:26:12 -04:00
|
|
|
enum class Modes { Normal, Done };
|
|
|
|
|
2021-05-20 14:43:54 -04:00
|
|
|
Timer(DisplayApp* app, Controllers::TimerController& timerController);
|
|
|
|
~Timer() override;
|
2021-07-19 09:26:12 -04:00
|
|
|
void Refresh() override;
|
2022-03-27 14:21:44 -04:00
|
|
|
void SetDone();
|
2021-05-20 14:43:54 -04:00
|
|
|
void OnButtonEvent(lv_obj_t* obj, lv_event_t event);
|
2021-07-19 09:26:12 -04:00
|
|
|
|
2021-05-20 14:43:54 -04:00
|
|
|
private:
|
2022-05-13 14:35:05 -04:00
|
|
|
void SetTimerRunning();
|
|
|
|
void SetTimerStopped();
|
2021-05-20 14:43:54 -04:00
|
|
|
Controllers::TimerController& timerController;
|
2022-03-27 14:21:44 -04:00
|
|
|
lv_obj_t* msecTime;
|
|
|
|
lv_obj_t* btnPlayPause;
|
|
|
|
lv_obj_t* txtPlayPause;
|
2021-07-19 09:26:12 -04:00
|
|
|
lv_task_t* taskRefresh;
|
2022-05-13 14:35:05 -04:00
|
|
|
Widgets::Counter minuteCounter = Widgets::Counter(0, 59);
|
|
|
|
Widgets::Counter secondCounter = Widgets::Counter(0, 59);
|
2021-05-20 14:43:54 -04:00
|
|
|
};
|
2021-07-19 09:26:12 -04:00
|
|
|
}
|