blob: 84177ea6fd37b74813ad73b3fce01041f7d1de4a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#pragma once
#include <memory>
#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<Screen> CreateScreenTemperature();
std::unique_ptr<Screen> CreateScreenAir();
std::unique_ptr<Screen> CreateScreenClouds();
std::unique_ptr<Screen> CreateScreenPrecipitation();
std::unique_ptr<Screen> CreateScreenHumidity();
};
}
template <>
struct AppTraits<Apps::Weather> {
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);
};
};
}
}
|