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"
|
2022-07-21 15:53:36 -04:00
|
|
|
#include <lvgl/lvgl.h>
|
2021-05-20 14:43:54 -04:00
|
|
|
|
|
|
|
#include "components/timer/TimerController.h"
|
|
|
|
|
|
|
|
namespace Pinetime::Applications::Screens {
|
|
|
|
class Timer : public Screen {
|
|
|
|
public:
|
|
|
|
Timer(DisplayApp* app, Controllers::TimerController& timerController);
|
|
|
|
~Timer() override;
|
2021-07-19 09:26:12 -04:00
|
|
|
void Refresh() override;
|
2022-07-21 15:53:36 -04:00
|
|
|
void Reset();
|
|
|
|
void ToggleRunning();
|
|
|
|
void ButtonPressed();
|
|
|
|
void MaskReset();
|
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();
|
2022-07-21 15:53:36 -04:00
|
|
|
void UpdateMask();
|
2021-05-20 14:43:54 -04:00
|
|
|
Controllers::TimerController& timerController;
|
2022-07-21 15:53:36 -04:00
|
|
|
|
2022-03-27 14:21:44 -04:00
|
|
|
lv_obj_t* msecTime;
|
|
|
|
lv_obj_t* btnPlayPause;
|
|
|
|
lv_obj_t* txtPlayPause;
|
2022-07-21 15:53:36 -04:00
|
|
|
|
|
|
|
lv_obj_t* btnObjectMask;
|
|
|
|
lv_obj_t* highlightObjectMask;
|
|
|
|
lv_objmask_mask_t* btnMask;
|
|
|
|
lv_objmask_mask_t* highlightMask;
|
|
|
|
|
2021-07-19 09:26:12 -04:00
|
|
|
lv_task_t* taskRefresh;
|
2022-06-06 17:30:42 -04:00
|
|
|
Widgets::Counter minuteCounter = Widgets::Counter(0, 59, jetbrains_mono_76);
|
|
|
|
Widgets::Counter secondCounter = Widgets::Counter(0, 59, jetbrains_mono_76);
|
2022-07-21 15:53:36 -04:00
|
|
|
|
|
|
|
bool buttonPressing = false;
|
|
|
|
int maskPosition = 0;
|
|
|
|
TickType_t pressTime;
|
2021-05-20 14:43:54 -04:00
|
|
|
};
|
2021-07-19 09:26:12 -04:00
|
|
|
}
|