39 lines
1021 B
C++
39 lines
1021 B
C++
#pragma once
|
|
|
|
#include "displayapp/screens/Screen.h"
|
|
#include "components/brightness/BrightnessController.h"
|
|
#include "systemtask/SystemTask.h"
|
|
#include <cstdint>
|
|
#include <lvgl/lvgl.h>
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
|
namespace Screens {
|
|
|
|
class FlashLight : public Screen {
|
|
public:
|
|
FlashLight(DisplayApp* app, System::SystemTask& systemTask, Controllers::BrightnessController& brightness);
|
|
~FlashLight() override;
|
|
|
|
bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
|
|
void Toggle();
|
|
|
|
private:
|
|
void SetIndicators();
|
|
void SetColors();
|
|
|
|
Pinetime::System::SystemTask& systemTask;
|
|
Controllers::BrightnessController& brightnessController;
|
|
|
|
Controllers::BrightnessController::Levels brightnessLevel = Controllers::BrightnessController::Levels::High;
|
|
|
|
lv_obj_t* flashLight;
|
|
lv_obj_t* backgroundAction;
|
|
lv_obj_t* indicators[3];
|
|
bool isOn = false;
|
|
};
|
|
}
|
|
}
|
|
}
|