2020-08-14 09:46:37 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-06-16 22:41:54 +03:00
|
|
|
#include <array>
|
2020-11-15 16:49:36 +01:00
|
|
|
#include <memory>
|
2020-10-02 22:16:48 +03:00
|
|
|
|
2021-10-13 22:08:35 +02:00
|
|
|
#include "displayapp/screens/Screen.h"
|
|
|
|
#include "displayapp/screens/ScreenList.h"
|
2021-04-04 03:08:51 +01:00
|
|
|
#include "components/datetime/DateTimeController.h"
|
|
|
|
#include "components/settings/Settings.h"
|
|
|
|
#include "components/battery/BatteryController.h"
|
2022-06-16 22:41:54 +03:00
|
|
|
#include "displayapp/screens/Symbols.h"
|
|
|
|
#include "displayapp/screens/Tile.h"
|
2023-09-02 19:43:39 +02:00
|
|
|
#include "displayapp/screens/Navigation.h"
|
2020-08-14 09:46:37 +02:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
class ApplicationList : public Screen {
|
2021-04-24 12:00:45 +03:00
|
|
|
public:
|
2021-04-18 20:28:14 +03:00
|
|
|
explicit ApplicationList(DisplayApp* app,
|
|
|
|
Pinetime::Controllers::Settings& settingsController,
|
2023-02-23 22:16:44 +02:00
|
|
|
const Pinetime::Controllers::Battery& batteryController,
|
2023-02-23 22:24:07 +02:00
|
|
|
const Pinetime::Controllers::Ble& bleController,
|
2023-09-02 19:43:39 +02:00
|
|
|
Controllers::DateTime& dateTimeController,
|
|
|
|
Pinetime::Controllers::FS& filesystem);
|
2021-04-18 20:28:14 +03:00
|
|
|
~ApplicationList() override;
|
|
|
|
bool OnTouchEvent(TouchEvents event) override;
|
2021-02-24 19:40:24 +00:00
|
|
|
|
2021-04-24 12:00:45 +03:00
|
|
|
private:
|
2023-02-22 22:05:37 +02:00
|
|
|
DisplayApp* app;
|
2022-06-16 22:41:54 +03:00
|
|
|
auto CreateScreenList() const;
|
|
|
|
std::unique_ptr<Screen> CreateScreen(unsigned int screenNum) const;
|
|
|
|
|
2021-04-18 20:28:14 +03:00
|
|
|
Controllers::Settings& settingsController;
|
2023-02-23 22:16:44 +02:00
|
|
|
const Pinetime::Controllers::Battery& batteryController;
|
2023-02-23 22:24:07 +02:00
|
|
|
const Pinetime::Controllers::Ble& bleController;
|
2021-04-18 20:28:14 +03:00
|
|
|
Controllers::DateTime& dateTimeController;
|
2023-09-02 19:43:39 +02:00
|
|
|
Pinetime::Controllers::FS& filesystem;
|
2020-08-14 09:46:37 +02:00
|
|
|
|
2022-06-16 22:41:54 +03:00
|
|
|
static constexpr int appsPerScreen = 6;
|
|
|
|
|
|
|
|
// Increment this when more space is needed
|
|
|
|
static constexpr int nScreens = 2;
|
|
|
|
|
2023-09-02 19:43:39 +02:00
|
|
|
std::array<Tile::Applications, appsPerScreen * nScreens> applications {{
|
|
|
|
{Symbols::stopWatch, Apps::StopWatch, true},
|
|
|
|
{Symbols::clock, Apps::Alarm, true},
|
|
|
|
{Symbols::hourGlass, Apps::Timer, true},
|
|
|
|
{Symbols::shoe, Apps::Steps, true},
|
|
|
|
{Symbols::heartBeat, Apps::HeartRate, true},
|
|
|
|
{Symbols::music, Apps::Music, true},
|
|
|
|
|
|
|
|
{"2", Apps::Twos, true},
|
|
|
|
{Symbols::drum, Apps::Metronome, true},
|
|
|
|
{Symbols::map, Apps::Navigation, Applications::Screens::Navigation::IsAvailable(filesystem)},
|
|
|
|
{Symbols::none, Apps::None, false},
|
2023-02-20 09:29:10 +02:00
|
|
|
|
|
|
|
// {"M", Apps::Motion},
|
2022-06-16 22:41:54 +03:00
|
|
|
}};
|
|
|
|
ScreenList<nScreens> screens;
|
2020-08-14 09:46:37 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2021-07-19 16:26:12 +03:00
|
|
|
}
|