OMOTE/Platformio/OmoteUI/core/ScreenManager.hpp
MatthewColvin 7b7045f62b convert Screen manager to use vector to allow popper of screen to use the Page.
Add ability to delay destruction of an object in LVGL after the core object has been destructed. This was added for animations to work .

make pop up Screen to allow for easy pushing of pages by wrapping it in a screen.

Use this all in the settings page to launch a fake display settings
2023-10-08 12:32:59 -05:00

33 lines
No EOL
717 B
C++

#pragma once
#include "PageBase.hpp"
#include "ScreenBase.hpp"
#include <memory>
#include <vector>
namespace UI::Screen {
class Manager {
public:
static Manager &getInstance();
void pushScreen(Screen::Base::Ptr aScreen);
void pushScreen(Screen::Base::Ptr aScreen,
lv_scr_load_anim_t aPushAnimationOverride);
void
pushPopUp(UI::Page::Base::Ptr aPopUpPage,
lv_scr_load_anim_t aPushAnimation = LV_SCR_LOAD_ANIM_OVER_LEFT);
Screen::Base::Ptr popScreen(Screen::Base *aScreenToRemove);
bool distributeKeyEvent(KeyPressAbstract::KeyEvent aKeyEvent);
private:
Manager();
static Manager mManager;
std::vector<Screen::Base::Ptr> mScreens;
};
} // namespace UI::Screen