summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Timer.h
blob: 0d66f2d46e5f61c2c7a9a35e8f60a149e2e023b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#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 {
  
  
  class Timer : public Screen {
  public:
    
    enum class Modes {
      Normal, Done
    };
    
    Timer(DisplayApp* app, Controllers::TimerController& timerController);
    
    ~Timer() override;
    
    bool Refresh() override;
    
    void setDone();
    
    void OnButtonEvent(lv_obj_t* obj, lv_event_t event);
  
  private:
    
    bool running;
    uint8_t secondsToSet = 0;
    uint8_t minutesToSet = 0;
    Controllers::TimerController& timerController;
    
    void createButtons();
    
    lv_obj_t* time, * msecTime, * btnPlayPause, * txtPlayPause, * btnMinutesUp, * btnMinutesDown, * btnSecondsUp, * btnSecondsDown, * txtMUp,
        * txtMDown, * txtSUp, * txtSDown;
  };
}