2020-08-14 09:46:37 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-06-16 21:41:54 +02:00
|
|
|
#include <array>
|
2020-11-15 16:49:36 +01:00
|
|
|
#include <memory>
|
2020-10-02 21:16:48 +02:00
|
|
|
|
2021-10-13 22:08:35 +02:00
|
|
|
#include "displayapp/screens/Screen.h"
|
|
|
|
#include "displayapp/screens/ScreenList.h"
|
2021-04-04 04:08:51 +02:00
|
|
|
#include "components/datetime/DateTimeController.h"
|
|
|
|
#include "components/settings/Settings.h"
|
|
|
|
#include "components/battery/BatteryController.h"
|
2022-06-16 21:41:54 +02:00
|
|
|
#include "displayapp/screens/Symbols.h"
|
|
|
|
#include "displayapp/screens/Tile.h"
|
2020-08-14 09:46:37 +02:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
class ApplicationList : public Screen {
|
2021-04-24 11:00:45 +02:00
|
|
|
public:
|
2021-04-18 19:28:14 +02:00
|
|
|
explicit ApplicationList(DisplayApp* app,
|
|
|
|
Pinetime::Controllers::Settings& settingsController,
|
|
|
|
Pinetime::Controllers::Battery& batteryController,
|
2022-07-21 18:27:52 +02:00
|
|
|
Pinetime::Controllers::Ble& bleController,
|
2021-04-18 19:28:14 +02:00
|
|
|
Controllers::DateTime& dateTimeController);
|
|
|
|
~ApplicationList() override;
|
|
|
|
bool OnTouchEvent(TouchEvents event) override;
|
2021-02-24 20:40:24 +01:00
|
|
|
|
2021-04-24 11:00:45 +02:00
|
|
|
private:
|
2022-06-16 21:41:54 +02:00
|
|
|
auto CreateScreenList() const;
|
|
|
|
std::unique_ptr<Screen> CreateScreen(unsigned int screenNum) const;
|
|
|
|
|
2021-04-18 19:28:14 +02:00
|
|
|
Controllers::Settings& settingsController;
|
|
|
|
Pinetime::Controllers::Battery& batteryController;
|
2022-07-21 18:27:52 +02:00
|
|
|
Pinetime::Controllers::Ble& bleController;
|
2021-04-18 19:28:14 +02:00
|
|
|
Controllers::DateTime& dateTimeController;
|
2020-08-14 09:46:37 +02:00
|
|
|
|
2022-06-16 21:41:54 +02:00
|
|
|
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;
|
2020-08-14 09:46:37 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2021-07-19 15:26:12 +02:00
|
|
|
}
|