2021-05-20 20:43:54 +02:00
|
|
|
#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 {
|
2021-07-19 15:26:12 +02:00
|
|
|
|
2021-05-20 20:43:54 +02:00
|
|
|
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);
|
2021-07-19 15:26:12 +02:00
|
|
|
|
2021-05-20 20:43:54 +02:00
|
|
|
~Timer() override;
|
2021-07-19 15:26:12 +02:00
|
|
|
|
|
|
|
void Refresh() override;
|
|
|
|
|
2021-05-20 20:43:54 +02:00
|
|
|
void setDone();
|
2021-07-19 15:26:12 +02:00
|
|
|
|
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:
|
|
|
|
bool running;
|
|
|
|
uint8_t secondsToSet = 0;
|
|
|
|
uint8_t minutesToSet = 0;
|
|
|
|
Controllers::TimerController& timerController;
|
2021-07-19 15:26:12 +02:00
|
|
|
|
2021-05-20 20:43:54 +02:00
|
|
|
void createButtons();
|
2021-07-19 15:26:12 +02:00
|
|
|
|
|
|
|
lv_obj_t *time, *msecTime, *btnPlayPause, *txtPlayPause, *btnMinutesUp, *btnMinutesDown, *btnSecondsUp, *btnSecondsDown, *txtMUp,
|
|
|
|
*txtMDown, *txtSUp, *txtSDown;
|
|
|
|
|
|
|
|
lv_task_t* taskRefresh;
|
2021-05-20 20:43:54 +02:00
|
|
|
};
|
2021-07-19 15:26:12 +02:00
|
|
|
}
|