mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-19 21:03:09 +00:00
Move the "Disconnect the Even App" page to before pairing rather than after, and make some minor changes to it
This commit is contained in:
1 parent
b74868bfb3
commit
a7a5005e8d
8 files changed
+39
-26
No files matched your search
@@ -4,8 +4,8 @@ import { ConfigViewModel } from "./config-view-model";
|
||||
|
||||
export function navigatingTo(args: NavigatedData): void {
|
||||
const page = args.object as Page;
|
||||
// Preserve the model across back-navigation (returning from the unpair page)
|
||||
// so the onboarding "Continue" flow isn't lost.
|
||||
// Preserve the model across back-navigation (returning from the firmware
|
||||
// check page) so the onboarding "Continue" flow isn't lost.
|
||||
if (!page.bindingContext) {
|
||||
const context = (args.context as { onboarding?: boolean } | undefined) ?? undefined;
|
||||
page.bindingContext = new ConfigViewModel({ onboarding: context?.onboarding ?? false });
|
||||
|
||||
@@ -232,8 +232,8 @@ export class ConfigViewModel extends Observable {
|
||||
return;
|
||||
}
|
||||
if (this.onboarding) {
|
||||
// Continue the onboarding chain: unpair the official app next.
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-unpair-page" });
|
||||
// Continue the onboarding chain: check the glasses' firmware next.
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-firmware-check-page" });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,11 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
||||
frame.goBack();
|
||||
return;
|
||||
}
|
||||
frame?.navigate({ moduleName: "phone-ui/onboarding-unpair-page", clearHistory: true });
|
||||
frame?.navigate({
|
||||
moduleName: "phone-ui/pairing-page",
|
||||
context: { onboarding: true },
|
||||
clearHistory: true,
|
||||
});
|
||||
}
|
||||
|
||||
/** Escape hatch when the check itself fails: flash as if stock firmware had been detected. */
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<GridLayout rows="*,auto" class="p-20">
|
||||
<ScrollView row="0">
|
||||
<StackLayout>
|
||||
<Label text="Disconnect the Even App" class="h1 text-center m-t-24" textWrap="true" />
|
||||
<Label text="Disconnect Other Apps" class="h1 text-center m-t-24" textWrap="true" />
|
||||
<Label
|
||||
text="Faceclaw and the official Even Realities app can't both be connected to the glasses at once. Before continuing, open the Even app, go to Home, select your glasses, open the Connection submenu, and press Disconnect (or turn off the Even app's Bluetooth)."
|
||||
text="Faceclaw and the official Even Realities app can't both be connected to the glasses at once. Before continuing, open the Even app, go to Home, select your glasses, open the Connection submenu, and press Disconnect (or turn off the Even app's Bluetooth). If any other glasses app is installed (such as Mentra), disconnect it too."
|
||||
class="body-text m-t-24" textWrap="true" />
|
||||
<Button text="Open Even App Settings" tap="{{ onOpenEvenAppSettingsTap }}" class="-primary m-t-24" />
|
||||
<Button text="Open Even App Settings" tap="{{ onOpenEvenAppSettingsTap }}" width="{{ settingsButtonWidth }}" horizontalAlignment="center" class="-primary m-t-24" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Frame, Observable } from "@nativescript/core";
|
||||
import { Frame, Observable, Screen } from "@nativescript/core";
|
||||
|
||||
import { openEvenAppSettings } from "../native/even-app-conflict";
|
||||
|
||||
@@ -8,7 +8,10 @@ export class OnboardingUnpairViewModel extends Observable {
|
||||
}
|
||||
|
||||
onContinueTap(): void {
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-firmware-check-page" });
|
||||
Frame.topmost()?.navigate({
|
||||
moduleName: "phone-ui/pairing-page",
|
||||
context: { onboarding: true },
|
||||
});
|
||||
}
|
||||
|
||||
onBackTap(): void {
|
||||
@@ -18,9 +21,17 @@ export class OnboardingUnpairViewModel extends Observable {
|
||||
return;
|
||||
}
|
||||
frame?.navigate({
|
||||
moduleName: "phone-ui/pairing-page",
|
||||
context: { onboarding: true },
|
||||
moduleName: "phone-ui/onboarding-page",
|
||||
context: { step: 3 },
|
||||
clearHistory: true,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The settings button fills the page's width on phones but is capped so it
|
||||
* doesn't stretch edge-to-edge on tablets.
|
||||
*/
|
||||
get settingsButtonWidth(): number {
|
||||
return Math.min(320, Math.round(Screen.mainScreen.widthDIPs) - 40);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ const STEP_CONTENT: Record<OnboardingStep, StepContent> = {
|
||||
headline: "Custom Firmware Required",
|
||||
tagline: "",
|
||||
body:
|
||||
"Faceclaw only runs on Even Realities G2 glasses that have Faceclaw's custom firmware installed. You have two choices:\n\n• Preview Only — explore Faceclaw's interface on your phone's screen without pairing any glasses. Nothing is written to a headset.\n\n• Flash Firmware — install the custom firmware on your glasses now, then use Faceclaw for real. Faceclaw first scans for nearby glasses so you can pick yours by model, colour, and serial, then connects, asks for confirmation on the lens, and downloads and prepares the firmware.\n\nFlashing replaces the official firmware. It may void your warranty and, like any firmware update, carries a risk of bricking the device. You can only be connected to one app at a time, so disconnect the official Even app before flashing (open it, go to Home, select your glasses, open Connection, and press Disconnect).",
|
||||
"Faceclaw only runs on Even Realities G2 glasses that have Faceclaw's custom firmware installed. You have two choices:\n\n• Preview Only — explore Faceclaw's interface on your phone's screen without pairing any glasses. Nothing is written to a headset.\n\n• Flash Firmware — install the custom firmware on your glasses now, then use Faceclaw for real. Faceclaw scans for nearby glasses so you can pick yours by model, colour, and serial, then connects, asks for confirmation on the lens, and downloads and prepares the firmware.\n\nFlashing replaces the official firmware. It may void your warranty and, like any firmware update, carries a risk of bricking the device. The glasses can only be connected to one app at a time, so the next step will walk you through disconnecting the official Even app (and any other glasses apps) first.",
|
||||
primaryLabel: "Flash Firmware",
|
||||
secondaryLabel: "Preview Only",
|
||||
splash: false,
|
||||
@@ -70,13 +70,11 @@ export class OnboardingViewModel extends Observable {
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Step 3 primary: begin the flashing setup — scan for and pick the glasses
|
||||
// (manual address entry is offered from that page), then unpair the
|
||||
// official app, then check firmware and flash.
|
||||
Frame.topmost()?.navigate({
|
||||
moduleName: "phone-ui/pairing-page",
|
||||
context: { onboarding: true },
|
||||
});
|
||||
// Step 3 primary: begin the flashing setup — disconnect other glasses apps
|
||||
// first (a connected app blocks our BLE access, including pairing), then
|
||||
// scan for and pick the glasses (manual address entry is offered from that
|
||||
// page), then check firmware and flash.
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-unpair-page" });
|
||||
}
|
||||
|
||||
onSecondaryTap(): void {
|
||||
|
||||
@@ -6,9 +6,9 @@ type PairingContext = { onboarding?: boolean } | undefined;
|
||||
|
||||
export function navigatingTo(args: NavigatedData): void {
|
||||
const page = args.object as Page;
|
||||
// Preserve the model across back-navigation (returning from the unpair or
|
||||
// manual-entry pages) so the selection isn't lost; the model restarts its
|
||||
// scan on re-entry.
|
||||
// Preserve the model across back-navigation (returning from the firmware
|
||||
// check or manual-entry pages) so the selection isn't lost; the model
|
||||
// restarts its scan on re-entry.
|
||||
let model = page.bindingContext as PairingViewModel | undefined;
|
||||
if (!model) {
|
||||
const context = args.context as PairingContext;
|
||||
|
||||
@@ -333,8 +333,8 @@ export class PairingViewModel extends Observable {
|
||||
this.dispose();
|
||||
if (this.onboarding) {
|
||||
setPreviewOnlyMode(false);
|
||||
// Continue the onboarding chain: unpair the official app next.
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-unpair-page" });
|
||||
// Continue the onboarding chain: check the glasses' firmware next.
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-firmware-check-page" });
|
||||
return;
|
||||
}
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/main-page", clearHistory: true });
|
||||
@@ -348,7 +348,7 @@ export class PairingViewModel extends Observable {
|
||||
return;
|
||||
}
|
||||
frame?.navigate({
|
||||
moduleName: this.onboarding ? "phone-ui/onboarding-page" : "phone-ui/main-page",
|
||||
moduleName: this.onboarding ? "phone-ui/onboarding-unpair-page" : "phone-ui/main-page",
|
||||
clearHistory: true,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user