OMOTE/Platformio/OmoteUI/UIs/BasicRefactored/screen/HomeScreen.cpp
MatthewColvin efa2d4a137 Rework Mains so they are basically as identical as possible.
Create HardwareFactory which is responsible for providing the HardwareAbstract to any part of the program based on compiler defines
2023-10-15 08:24:29 -05:00

28 lines
788 B
C++

#include "HomeScreen.hpp"
#include "Colors.hpp"
#include "Demo.hpp"
#include "SettingsPage.hpp"
using namespace UI::Screen;
HomeScreen::HomeScreen()
: Base(UI::ID::Screens::Home),
mTabView(AddElement<Page::TabView>(
std::make_unique<Page::TabView>(ID(ID::Pages::INVALID_PAGE_ID)))) {
SetBgColor(UI::Color::BLACK);
SetPushAnimation(LV_SCR_LOAD_ANIM_FADE_IN);
// Adds pages to the Tab view
mTabView->AddTab(std::make_unique<Page::SettingsPage>());
mTabView->AddTab(std::make_unique<Page::Demo>());
}
void HomeScreen::SetBgColor(lv_color_t value, lv_style_selector_t selector) {
mTabView->SetBgColor(value, selector);
UI::UIElement::SetBgColor(value, selector);
}
bool HomeScreen::OnKeyEvent(KeyPressAbstract::KeyEvent aKeyEvent) {
return false;
};