
The DisplayApp class isn't used in the Screen base class and most screens, so requiring it is pointless. In this commit, DisplayApp pointers were added to screens which use it and the explicit Screen constructor was removed in those screens.
46 lines
990 B
C++
46 lines
990 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <components/ble/weather/WeatherService.h>
|
|
#include "Screen.h"
|
|
#include "ScreenList.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<Screen> CreateScreenTemperature();
|
|
|
|
std::unique_ptr<Screen> CreateScreenAir();
|
|
|
|
std::unique_ptr<Screen> CreateScreenClouds();
|
|
|
|
std::unique_ptr<Screen> CreateScreenPrecipitation();
|
|
|
|
std::unique_ptr<Screen> CreateScreenHumidity();
|
|
};
|
|
}
|
|
}
|
|
}
|