mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +01:00
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
53 lines
1.1 KiB
C++
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);
|
|
}
|
|
|
|
}
|