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"
|
2021-05-20 14:43:54 -04:00
|
|
|
|
|
|
|
#include "components/timer/TimerController.h"
|
|
|
|
|
|
|
|
namespace Pinetime::Applications::Screens {
|
2021-07-19 09:26:12 -04:00
|
|
|
|
2021-05-20 14:43:54 -04:00
|
|
|
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);
|
2021-07-19 09:26:12 -04:00
|
|
|
|
2021-05-20 14:43:54 -04:00
|
|
|
~Timer() override;
|
2021-07-19 09:26:12 -04:00
|
|
|
|
|
|
|
void Refresh() override;
|
|
|
|
|
2021-05-20 14:43:54 -04:00
|
|
|
void setDone();
|
2021-07-19 09:26:12 -04:00
|
|
|
|
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:
|
|
|
|
bool running;
|
|
|
|
uint8_t secondsToSet = 0;
|
|
|
|
uint8_t minutesToSet = 0;
|
|
|
|
Controllers::TimerController& timerController;
|
2021-07-19 09:26:12 -04:00
|
|
|
|
2021-05-20 14:43:54 -04:00
|
|
|
void createButtons();
|
2021-07-19 09:26:12 -04:00
|
|
|
|
|
|
|
lv_obj_t *time, *msecTime, *btnPlayPause, *txtPlayPause, *btnMinutesUp, *btnMinutesDown, *btnSecondsUp, *btnSecondsDown, *txtMUp,
|
|
|
|
*txtMDown, *txtSUp, *txtSDown;
|
|
|
|
|
|
|
|
lv_task_t* taskRefresh;
|
2021-05-20 14:43:54 -04:00
|
|
|
};
|
2021-07-19 09:26:12 -04:00
|
|
|
}
|