1
0
Fork 0
InfiniTime/src/displayapp/screens/Timer.h

40 lines
906 B
C
Raw Normal View History

#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
class Timer : public Screen {
public:
2021-07-19 15:26:12 +02:00
enum class Modes { Normal, Done };
Timer(DisplayApp* app, Controllers::TimerController& timerController);
2021-07-19 15:26:12 +02:00
~Timer() override;
2021-07-19 15:26:12 +02:00
void Refresh() override;
void setDone();
2021-07-19 15:26:12 +02:00
void OnButtonEvent(lv_obj_t* obj, lv_event_t event);
2021-07-19 15:26:12 +02:00
private:
bool running;
uint8_t secondsToSet = 0;
uint8_t minutesToSet = 0;
Controllers::TimerController& timerController;
2021-07-19 15:26:12 +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-07-19 15:26:12 +02:00
}