2020-02-16 17:32:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-11-15 15:49:36 +00:00
|
|
|
#include <lvgl/lvgl.h>
|
2020-02-16 17:32:36 +00:00
|
|
|
#include <cstdint>
|
2020-11-15 15:49:36 +00:00
|
|
|
#include <memory>
|
|
|
|
#include "Screen.h"
|
|
|
|
#include "../Apps.h"
|
2021-04-04 02:08:51 +00:00
|
|
|
#include "components/datetime/DateTimeController.h"
|
2021-02-24 19:40:24 +00:00
|
|
|
#include "components/settings/Settings.h"
|
2021-04-04 02:08:51 +00:00
|
|
|
#include "components/datetime/DateTimeController.h"
|
|
|
|
#include "components/battery/BatteryController.h"
|
2020-02-16 17:32:36 +00:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
class Tile : public Screen {
|
2021-04-24 09:00:45 +00:00
|
|
|
public:
|
2021-04-18 17:28:14 +00:00
|
|
|
struct Applications {
|
|
|
|
const char* icon;
|
|
|
|
Pinetime::Applications::Apps application;
|
|
|
|
};
|
|
|
|
|
|
|
|
explicit Tile(uint8_t screenID,
|
|
|
|
uint8_t numScreens,
|
|
|
|
DisplayApp* app,
|
|
|
|
Controllers::Settings& settingsController,
|
|
|
|
Pinetime::Controllers::Battery& batteryController,
|
|
|
|
Controllers::DateTime& dateTimeController,
|
|
|
|
std::array<Applications, 6>& applications);
|
|
|
|
|
|
|
|
~Tile() override;
|
|
|
|
|
|
|
|
bool Refresh() override;
|
|
|
|
void UpdateScreen();
|
|
|
|
void OnObjectEvent(lv_obj_t* obj, lv_event_t event, uint32_t buttonId);
|
|
|
|
|
2021-04-24 09:00:45 +00:00
|
|
|
private:
|
2021-04-18 17:28:14 +00:00
|
|
|
Pinetime::Controllers::Battery& batteryController;
|
|
|
|
Controllers::DateTime& dateTimeController;
|
|
|
|
|
|
|
|
lv_task_t* taskUpdate;
|
|
|
|
|
|
|
|
lv_obj_t* label_time;
|
|
|
|
lv_obj_t* batteryIcon;
|
|
|
|
lv_point_t pageIndicatorBasePoints[2];
|
|
|
|
lv_point_t pageIndicatorPoints[2];
|
|
|
|
lv_obj_t* pageIndicatorBase;
|
|
|
|
lv_obj_t* pageIndicator;
|
|
|
|
lv_obj_t* btnm1;
|
|
|
|
|
|
|
|
const char* btnmMap[8];
|
|
|
|
Pinetime::Applications::Apps apps[6];
|
2020-02-16 17:32:36 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|