InfiniTime/src/displayapp/screens/Timer.h

34 lines
950 B
C
Raw Normal View History

#pragma once
#include "displayapp/screens/Screen.h"
#include "components/datetime/DateTimeController.h"
#include "systemtask/SystemTask.h"
#include "displayapp/LittleVgl.h"
2022-05-13 18:35:05 +00:00
#include "displayapp/widgets/Counter.h"
#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 };
Timer(DisplayApp* app, Controllers::TimerController& timerController);
~Timer() override;
2021-07-19 13:26:12 +00:00
void Refresh() override;
void SetDone();
void OnButtonEvent(lv_obj_t* obj, lv_event_t event);
2021-07-19 13:26:12 +00:00
private:
2022-05-13 18:35:05 +00:00
void SetTimerRunning();
void SetTimerStopped();
Controllers::TimerController& timerController;
lv_obj_t* msecTime;
lv_obj_t* btnPlayPause;
lv_obj_t* txtPlayPause;
2021-07-19 13:26:12 +00:00
lv_task_t* taskRefresh;
2022-05-13 18:35:05 +00:00
Widgets::Counter minuteCounter = Widgets::Counter(0, 59);
Widgets::Counter secondCounter = Widgets::Counter(0, 59);
};
2021-07-19 13:26:12 +00:00
}