forked from Blendman974/faceclaw
Phone UI: Settings are a page instead of a tab, watch vs ring style input is a setting rather than a tab, EvenHub webview is a button with the main buttons rather than in the top bar
This commit is contained in:
1 parent
a02b849200
commit
cd61fefb21
35 files changed
+848
-429
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { EventData, NavigatedData, Page } from "@nativescript/core";
|
||||
|
||||
import { SettingsViewModel } from "./settings-view-model";
|
||||
|
||||
/**
|
||||
* The phone's settings page, opened by the gear button under the main page's
|
||||
* mirror. Shared by Android and iOS (registered in onboarding-register.ios.ts).
|
||||
*/
|
||||
export function navigatingTo(args: NavigatedData): void {
|
||||
const page = args.object as Page;
|
||||
if (!page.bindingContext) page.bindingContext = new SettingsViewModel();
|
||||
}
|
||||
|
||||
// loaded/unloaded also bracket an app suspend, so the model's subscriptions
|
||||
// only live while the page is actually on screen.
|
||||
export function loaded(args: EventData): void {
|
||||
((args.object as Page).bindingContext as SettingsViewModel | undefined)?.attach();
|
||||
}
|
||||
|
||||
export function unloaded(args: EventData): void {
|
||||
((args.object as Page).bindingContext as SettingsViewModel | undefined)?.detach();
|
||||
}
|
||||
Reference in new issue
Block a user