diff --git a/app/app.css b/app/app.css
index b981046b..6e4dda3a 100644
--- a/app/app.css
+++ b/app/app.css
@@ -50,6 +50,31 @@ Button.-primary {
tint-color: #e6e6e6;
}
+/* License / privacy-policy links in the onboarding disclaimer footer. The
+ * padding widens the tap target beyond the small text. */
+.footer-link {
+ color: #3b6fd6;
+ font-size: 15;
+ text-decoration: underline;
+ padding: 4 8;
+}
+
+.ns-dark .footer-link {
+ color: #8ab0ff;
+}
+
+.footer-link-separator {
+ color: #777777;
+ font-size: 15;
+ padding: 4 0;
+}
+
+/* Bundled project docs (phone-ui/document-page). LICENSE and PRIVACY are
+ * hard-wrapped plain text, so keep the size modest to limit rewrapping. */
+.document-text {
+ font-size: 13;
+}
+
/*
* Stands in for the lens preview when showing it would be misleading (silent
* mode, or a disconnect explained by a flat battery). Sized by the view model
diff --git a/app/phone-ui/document-page.ts b/app/phone-ui/document-page.ts
new file mode 100644
index 00000000..a9e6ad0c
--- /dev/null
+++ b/app/phone-ui/document-page.ts
@@ -0,0 +1,26 @@
+import { Frame, NavigatedData, Page, knownFolders } from "@nativescript/core";
+
+/** Phone-side viewer for the project docs that webpack.config.js copies into
+ * the bundle under about/ (LICENSE, PRIVACY, ...). The glasses-side
+ * equivalent lives in ui/dashboard/settings-menus.ts. */
+type DocumentContext = { fileName?: string; title?: string } | undefined;
+
+export function navigatingTo(args: NavigatedData): void {
+ const page = args.object as Page;
+ const context = args.context as DocumentContext;
+ const fileName = context?.fileName ?? "";
+ page.bindingContext = {
+ title: context?.title ?? fileName,
+ text: readBundledDoc(fileName),
+ onBackTap: () => Frame.topmost()?.goBack(),
+ };
+}
+
+function readBundledDoc(fileName: string): string {
+ try {
+ const text = knownFolders.currentApp().getFile(`about/${fileName}`).readTextSync();
+ return text || `(${fileName} is missing from this build)`;
+ } catch {
+ return `(${fileName} is missing from this build)`;
+ }
+}
diff --git a/app/phone-ui/document-page.xml b/app/phone-ui/document-page.xml
new file mode 100644
index 00000000..a0812b9a
--- /dev/null
+++ b/app/phone-ui/document-page.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/phone-ui/onboarding-page.xml b/app/phone-ui/onboarding-page.xml
index 6608ce8f..00ef31c8 100644
--- a/app/phone-ui/onboarding-page.xml
+++ b/app/phone-ui/onboarding-page.xml
@@ -1,5 +1,5 @@
-
+
@@ -13,7 +13,13 @@
-
+
+
+
+
+
+
+
diff --git a/app/phone-ui/onboarding-view-model.ts b/app/phone-ui/onboarding-view-model.ts
index b2b84071..d53f5af6 100644
--- a/app/phone-ui/onboarding-view-model.ts
+++ b/app/phone-ui/onboarding-view-model.ts
@@ -77,6 +77,21 @@ export class OnboardingViewModel extends Observable {
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-unpair-page" });
}
+ onLicenseTap(): void {
+ this.openDocument("LICENSE", "License (GPLv3)");
+ }
+
+ onPrivacyTap(): void {
+ this.openDocument("PRIVACY", "Privacy Policy");
+ }
+
+ private openDocument(fileName: string, title: string): void {
+ Frame.topmost()?.navigate({
+ moduleName: "phone-ui/document-page",
+ context: { fileName, title },
+ });
+ }
+
onSecondaryTap(): void {
if (this._step === 2) {
this.setStep(1);
@@ -138,6 +153,11 @@ export class OnboardingViewModel extends Observable {
return this.showSecondary ? "visible" : "collapse";
}
+ /** License and privacy-policy links, shown only under the disclaimer step. */
+ get footerVisibility(): "visible" | "collapse" {
+ return this._step === 2 ? "visible" : "collapse";
+ }
+
private setStep(step: OnboardingStep): void {
if (this._step === step) return;
this._step = step;
@@ -154,5 +174,6 @@ export class OnboardingViewModel extends Observable {
this.notifyPropertyChange("splashVisibility", this.splashVisibility);
this.notifyPropertyChange("contentVisibility", this.contentVisibility);
this.notifyPropertyChange("secondaryVisibility", this.secondaryVisibility);
+ this.notifyPropertyChange("footerVisibility", this.footerVisibility);
}
}