2021-05-20 20:43:54 +02:00
|
|
|
#pragma once
|
|
|
|
|
2021-10-13 22:08:35 +02:00
|
|
|
#include "displayapp/screens/Screen.h"
|
2021-05-20 20:43:54 +02:00
|
|
|
#include "components/datetime/DateTimeController.h"
|
|
|
|
#include "systemtask/SystemTask.h"
|
2021-10-13 22:08:35 +02:00
|
|
|
#include "displayapp/LittleVgl.h"
|
2021-05-20 20:43:54 +02:00
|
|
|
|
|
|
|
#include "components/timer/TimerController.h"
|
|
|
|
|
|
|
|
namespace Pinetime::Applications::Screens {
|
|
|
|
class Timer : public Screen {
|
|
|
|
public:
|
2021-07-19 15:26:12 +02:00
|
|
|
enum class Modes { Normal, Done };
|
|
|
|
|
2021-05-20 20:43:54 +02:00
|
|
|
Timer(DisplayApp* app, Controllers::TimerController& timerController);
|
|
|
|
~Timer() override;
|
2021-07-19 15:26:12 +02:00
|
|
|
void Refresh() override;
|
2022-03-27 20:21:44 +02:00
|
|
|
void SetDone();
|
2021-05-20 20:43:54 +02:00
|
|
|
void OnButtonEvent(lv_obj_t* obj, lv_event_t event);
|
2021-07-19 15:26:12 +02:00
|
|
|
|
2021-05-20 20:43:54 +02:00
|
|
|
private:
|
2022-03-27 20:21:44 +02:00
|
|
|
void CreateButtons();
|
2021-05-20 20:43:54 +02:00
|
|
|
bool running;
|
|
|
|
uint8_t secondsToSet = 0;
|
|
|
|
uint8_t minutesToSet = 0;
|
|
|
|
Controllers::TimerController& timerController;
|
2022-03-27 20:21:44 +02: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 15:26:12 +02:00
|
|
|
lv_task_t* taskRefresh;
|
2021-05-20 20:43:54 +02:00
|
|
|
};
|
2021-07-19 15:26:12 +02:00
|
|
|
}
|