#pragma once #include #include "components/ble/weather/WeatherService.h" #include "Screen.h" #include "ScreenList.h" #include "displayapp/Apps.h" #include "displayapp/Controllers.h" #include "Symbols.h" namespace Pinetime { namespace Applications { class DisplayApp; namespace Screens { class Weather : public Screen { public: explicit Weather(DisplayApp* app, Pinetime::Controllers::WeatherService& weather); ~Weather() override; void Refresh() override; bool OnButtonPushed() override; bool OnTouchEvent(TouchEvents event) override; private: DisplayApp* app; bool running = true; Controllers::WeatherService& weatherService; ScreenList<5> screens; std::unique_ptr CreateScreenTemperature(); std::unique_ptr CreateScreenAir(); std::unique_ptr CreateScreenClouds(); std::unique_ptr CreateScreenPrecipitation(); std::unique_ptr CreateScreenHumidity(); }; } template <> struct AppTraits { static constexpr Apps app = Apps::Weather; static constexpr const char* icon = Screens::Symbols::sun; static Screens::Screen* Create(AppControllers& controllers) { return new Screens::Weather(controllers.displayApp, *controllers.weatherController); }; }; } }