Files
Upsilon/apps/on_boarding/app.cpp
Gabriel Ozouf 62f598110e [apps/shared] Created LocalizationController
Classes LanguageController and CountryController have been fused into
one class LocalizationController, as they were very similar. This allows
the Settings and OnBoarding apps to only keep one controller for both
functions.

Change-Id: Ic23f300c37122249d34caaf18a633b5815240a78
2020-11-04 15:11:44 +01:00

53 lines
1.1 KiB
C++

#include "app.h"
#include "../apps_container.h"
#include <assert.h>
namespace OnBoarding {
App * App::Snapshot::unpack(Container * container) {
return new (container->currentAppBuffer()) App(this);
}
App::Descriptor * App::Snapshot::descriptor() {
static Descriptor descriptor;
return &descriptor;
}
App::App(Snapshot * snapshot) :
::App(snapshot, &m_localizationController),
m_localizationController(&m_modalViewController, Metric::CommonTopMargin, LocalizationController::Mode::Language),
m_logoController()
{
}
int App::numberOfTimers() {
return firstResponder() == &m_logoController;
}
Timer * App::timerAtIndex(int i) {
assert(i == 0);
return &m_logoController;
}
bool App::processEvent(Ion::Events::Event e) {
if (e == Ion::Events::Home) {
return true;
}
if (e == Ion::Events::OnOff) {
Ion::Power::standby(); // Force a core reset to exit
}
return ::App::processEvent(e);
}
void App::didBecomeActive(Window * window) {
::App::didBecomeActive(window);
reinitOnBoarding();
}
void App::reinitOnBoarding() {
m_localizationController.resetSelection();
displayModalViewController(&m_logoController, 0.5f, 0.5f);
}
}