InfiniTime/src/displayapp/screens/Timer.h

40 lines
933 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"
#include "components/timer/TimerController.h"
namespace Pinetime::Applications::Screens {
2021-07-19 09:26:12 -04:00
class Timer : public Screen {
public:
2021-07-19 09:26:12 -04:00
enum class Modes { Normal, Done };
Timer(DisplayApp* app, Controllers::TimerController& timerController);
2021-07-19 09:26:12 -04:00
~Timer() override;
2021-07-19 09:26:12 -04:00
void Refresh() override;
void setDone();
2021-07-19 09:26:12 -04:00
void OnButtonEvent(lv_obj_t* obj, lv_event_t event);
2021-07-19 09:26:12 -04:00
private:
bool running;
uint8_t secondsToSet = 0;
uint8_t minutesToSet = 0;
Controllers::TimerController& timerController;
2021-07-19 09:26:12 -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-07-19 09:26:12 -04:00
}