2021-05-20 18:43:54 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-10-13 20:08:35 +00:00
|
|
|
#include "displayapp/screens/Screen.h"
|
2021-05-20 18:43:54 +00:00
|
|
|
#include "components/datetime/DateTimeController.h"
|
|
|
|
#include "systemtask/SystemTask.h"
|
2021-10-13 20:08:35 +00:00
|
|
|
#include "displayapp/LittleVgl.h"
|
2021-05-20 18:43:54 +00:00
|
|
|
|
|
|
|
#include "components/timer/TimerController.h"
|
|
|
|
|
|
|
|
namespace Pinetime::Applications::Screens {
|
|
|
|
class Timer : public Screen {
|
|
|
|
public:
|
2021-07-19 13:26:12 +00:00
|
|
|
enum class Modes { Normal, Done };
|
|
|
|
|
2021-05-20 18:43:54 +00:00
|
|
|
Timer(DisplayApp* app, Controllers::TimerController& timerController);
|
|
|
|
~Timer() override;
|
2021-07-19 13:26:12 +00:00
|
|
|
void Refresh() override;
|
2022-03-27 18:21:44 +00:00
|
|
|
void SetDone();
|
2021-05-20 18:43:54 +00:00
|
|
|
void OnButtonEvent(lv_obj_t* obj, lv_event_t event);
|
2021-07-19 13:26:12 +00:00
|
|
|
|
2021-05-20 18:43:54 +00:00
|
|
|
private:
|
2022-03-27 18:21:44 +00:00
|
|
|
void CreateButtons();
|
2021-05-20 18:43:54 +00:00
|
|
|
bool running;
|
|
|
|
uint8_t secondsToSet = 0;
|
|
|
|
uint8_t minutesToSet = 0;
|
|
|
|
Controllers::TimerController& timerController;
|
2022-03-27 18:21:44 +00:00
|
|
|
lv_obj_t* backgroundLabel;
|
|
|
|
lv_obj_t* time;
|
|
|
|
lv_obj_t* msecTime;
|
|
|
|
lv_obj_t* btnPlayPause;
|
|
|
|
lv_obj_t* txtPlayPause;
|
|
|
|
lv_obj_t* btnMinutesUp;
|
|
|
|
lv_obj_t* btnMinutesDown;
|
|
|
|
lv_obj_t* btnSecondsUp;
|
|
|
|
lv_obj_t* btnSecondsDown;
|
|
|
|
lv_obj_t* txtMUp;
|
|
|
|
lv_obj_t* txtMDown;
|
|
|
|
lv_obj_t* txtSUp;
|
|
|
|
lv_obj_t* txtSDown;
|
2021-07-19 13:26:12 +00:00
|
|
|
lv_task_t* taskRefresh;
|
2021-05-20 18:43:54 +00:00
|
|
|
};
|
2021-07-19 13:26:12 +00:00
|
|
|
}
|