OMOTE/Platformio/OmoteUI/UIs/BasicRefactored/screen/HomeScreen.cpp
Matthew Colvin 7d68cce6ad Add start stop event handling in UIElement
Add demo page to get play logic out of settings page.

Add a demo page and a Settings page to the home screen.
2023-10-12 15:25:42 -05:00

29 lines
872 B
C++

#include "HomeScreen.hpp"
#include "Colors.hpp"
#include "SettingsPage.hpp"
#include "Demo.hpp"
using namespace UI::Screen;
HomeScreen::HomeScreen(std::shared_ptr<HardwareAbstract> aHardware)
: Base(UI::ID::Screens::Home),
mTabView( AddElement<Page::TabView>(std::make_unique<Page::TabView>(
ID(ID::Pages::INVALID_PAGE_ID)))),
mHardware(aHardware) {
SetBgColor(UI::Color::BLACK);
SetPushAnimation(LV_SCR_LOAD_ANIM_FADE_IN);
// Adds pages to the Tab view
mTabView->AddTab(std::make_unique<Page::SettingsPage>(aHardware));
mTabView->AddTab(std::make_unique<Page::Demo>(aHardware));
}
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;
};