-
-
Notifications
You must be signed in to change notification settings - Fork 959
/
Copy pathFlashLight.h
40 lines (31 loc) · 1.08 KB
/
FlashLight.h
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
#pragma once
#include "displayapp/screens/Screen.h"
#include "components/brightness/BrightnessController.h"
#include "systemtask/SystemTask.h"
#include "systemtask/WakeLock.h"
#include <cstdint>
#include <lvgl/lvgl.h>
namespace Pinetime {
namespace Applications {
namespace Screens {
class FlashLight : public Screen {
public:
FlashLight(System::SystemTask& systemTask, Controllers::BrightnessController& brightness);
~FlashLight() override;
bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
void Toggle();
private:
void SetIndicators();
void SetColors();
Pinetime::System::WakeLock wakeLock;
Controllers::BrightnessController& brightnessController;
Controllers::BrightnessController::Levels brightnessLevel = Controllers::BrightnessController::Levels::High;
Controllers::BrightnessController::Levels previousBrightnessLevel;
lv_obj_t* flashLight;
lv_obj_t* backgroundAction;
lv_obj_t* indicators[3];
bool isOn = false;
};
}
}
}