mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-29 13:03:11 +00:00
G1 support: Flashing within the Android app
This commit is contained in:
1 parent
345ba36c33
commit
38c52ebc31
37 files changed
+2819
-32
No files matched your search
@@ -1,5 +1,7 @@
|
||||
import { NavigatedData, Page } from "@nativescript/core";
|
||||
|
||||
import { glassesTypeSetting } from "../ui/dashboard-settings";
|
||||
import { G1FlashViewModel } from "./g1-flash-view-model";
|
||||
import { FlashMode, OnboardingFlashViewModel } from "./onboarding-flash-view-model";
|
||||
|
||||
export function navigatingTo(args: NavigatedData): void {
|
||||
@@ -7,16 +9,17 @@ export function navigatingTo(args: NavigatedData): void {
|
||||
if (!page.bindingContext) {
|
||||
const context =
|
||||
(args.context as { mode?: FlashMode; fromOnboarding?: boolean; autoStart?: boolean } | undefined) ?? undefined;
|
||||
page.bindingContext = new OnboardingFlashViewModel({
|
||||
const options = {
|
||||
mode: context?.mode ?? "install",
|
||||
fromOnboarding: context?.fromOnboarding ?? true,
|
||||
autoStart: context?.autoStart ?? false,
|
||||
});
|
||||
};
|
||||
page.bindingContext = glassesTypeSetting.get() === "g1" ? new G1FlashViewModel(options) : new OnboardingFlashViewModel(options);
|
||||
}
|
||||
}
|
||||
|
||||
export function navigatingFrom(args: NavigatedData): void {
|
||||
const page = args.object as Page;
|
||||
(page.bindingContext as OnboardingFlashViewModel | undefined)?.dispose();
|
||||
(page.bindingContext as OnboardingFlashViewModel | G1FlashViewModel | undefined)?.dispose();
|
||||
page.bindingContext = null;
|
||||
}
|
||||
Reference in new issue
Block a user