InfiniTime/src/displayapp/screens/ApplicationList.h

61 lines
2.1 KiB
C
Raw Normal View History

#pragma once
#include <array>
2020-11-15 15:49:36 +00:00
#include <memory>
#include "displayapp/screens/Screen.h"
#include "displayapp/screens/ScreenList.h"
#include "components/datetime/DateTimeController.h"
#include "components/settings/Settings.h"
#include "components/battery/BatteryController.h"
#include "displayapp/screens/Symbols.h"
#include "displayapp/screens/Tile.h"
namespace Pinetime {
namespace Applications {
namespace Screens {
class ApplicationList : public Screen {
2021-04-24 09:00:45 +00:00
public:
explicit ApplicationList(DisplayApp* app,
Pinetime::Controllers::Settings& settingsController,
Pinetime::Controllers::Battery& batteryController,
2022-07-21 16:27:52 +00:00
Pinetime::Controllers::Ble& bleController,
Controllers::DateTime& dateTimeController);
~ApplicationList() override;
bool OnTouchEvent(TouchEvents event) override;
2021-04-24 09:00:45 +00:00
private:
auto CreateScreenList() const;
std::unique_ptr<Screen> CreateScreen(unsigned int screenNum) const;
Controllers::Settings& settingsController;
Pinetime::Controllers::Battery& batteryController;
2022-07-21 16:27:52 +00:00
Pinetime::Controllers::Ble& bleController;
Controllers::DateTime& dateTimeController;
static constexpr int appsPerScreen = 6;
// Increment this when more space is needed
static constexpr int nScreens = 2;
static constexpr std::array<Tile::Applications, appsPerScreen * nScreens> applications {{
{Symbols::stopWatch, Apps::StopWatch},
{Symbols::clock, Apps::Alarm},
{Symbols::hourGlass, Apps::Timer},
{Symbols::shoe, Apps::Steps},
{Symbols::heartBeat, Apps::HeartRate},
{Symbols::music, Apps::Music},
{Symbols::paintbrush, Apps::Paint},
{Symbols::paddle, Apps::Paddle},
{"2", Apps::Twos},
{Symbols::chartLine, Apps::Motion},
{Symbols::drum, Apps::Metronome},
{Symbols::map, Apps::Navigation},
}};
ScreenList<nScreens> screens;
};
}
}
2021-07-19 13:26:12 +00:00
}