forked from Blendman974/faceclaw
Prepare 0.8.3-rc1 TestFlight beta and public signup
This commit is contained in:
1 parent
5df873e5b1
commit
e5f6dc1976
17 files changed
+263
-40
No files matched your search
@@ -31,9 +31,9 @@ export class DataCollectionPage implements OnboardingPage {
|
||||
paint(image: GrayImage, focused: boolean): void {
|
||||
const top = drawPageHeading(
|
||||
image,
|
||||
"Data collection",
|
||||
"Choose what Faceclaw may send its developers to help fix problems and improve the app. " +
|
||||
"You can change this later in Settings > Privacy.",
|
||||
"Faceclaw statistics",
|
||||
(global.isIOS ? "If using TestFlight, crash/usage reports cannot be disabled here. " : "") +
|
||||
"Choose optional Faceclaw statistics. Change later in Settings > Privacy.",
|
||||
3,
|
||||
) + CONTENT_GAP;
|
||||
const body = onboardingFont("body");
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import { IOS_PRIVACY_NOTICE } from "../../analytics/privacy-disclosure";
|
||||
import type { GrayImage } from "../../graphics/image";
|
||||
import { wrapText } from "../../graphics/textwrap";
|
||||
import type { InputEvent } from "../../ui/gestures";
|
||||
import { onboardingFont } from "./onboarding-fonts";
|
||||
import { drawPageHeading, PAGE_X, type OnboardingNav, type OnboardingPage } from "./onboarding-page";
|
||||
|
||||
/** Paginate the notice so no disclosure is silently clipped on a short glasses viewport. */
|
||||
export class IosPrivacyPage implements OnboardingPage {
|
||||
private page = 0;
|
||||
private pageCount = 1;
|
||||
|
||||
enter(): void { this.page = 0; }
|
||||
|
||||
paint(image: GrayImage): void {
|
||||
const top = drawPageHeading(image, "iOS / TestFlight privacy", "") + 8;
|
||||
const font = onboardingFont("detail");
|
||||
const lines = IOS_PRIVACY_NOTICE.split("\n\n").flatMap((paragraph, index) => [
|
||||
...(index ? [""] : []), ...wrapText(font, paragraph, image.width - 2 * PAGE_X),
|
||||
]);
|
||||
const perPage = Math.max(1, Math.floor((image.height - top - font.lineHeight - 20) / font.lineHeight));
|
||||
this.pageCount = Math.ceil(lines.length / perPage);
|
||||
this.page = Math.min(this.page, this.pageCount - 1);
|
||||
lines.slice(this.page * perPage, (this.page + 1) * perPage).forEach((line, index) => {
|
||||
image.drawText(font, PAGE_X, top + index * font.lineHeight, line, 200);
|
||||
});
|
||||
const action = this.page + 1 < this.pageCount ? "Tap for more" : "Tap to choose statistics";
|
||||
image.drawText(font, PAGE_X, image.height - font.lineHeight - 8,
|
||||
`${this.page + 1}/${this.pageCount} - ${action}`, 230);
|
||||
}
|
||||
|
||||
handleInput(event: InputEvent, nav: OnboardingNav): void {
|
||||
if (event.type === "click") {
|
||||
if (this.page + 1 < this.pageCount) this.page++;
|
||||
else nav.next();
|
||||
} else if (event.type === "scroll-down" || event.type === "swipe-up") {
|
||||
this.page = Math.min(this.page + 1, this.pageCount - 1);
|
||||
} else if (event.type === "scroll-up" || event.type === "swipe-down") {
|
||||
this.page = Math.max(0, this.page - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { createInProcessWindow, type InProcessAppOptions, type InProcessWindow }
|
||||
import { shell } from "../../ui/shell/shell";
|
||||
import { findSoundEffect, playSoundEffect } from "../../ui/sound-effects";
|
||||
import { DataCollectionPage } from "./data-collection-page";
|
||||
import { IosPrivacyPage } from "./ios-privacy-page";
|
||||
import { markGlassesOnboardingFinished, ONBOARDING_APP_ID } from "./onboarding-progress";
|
||||
import type { OnboardingPage } from "./onboarding-page";
|
||||
import { TextSizePage } from "./text-size-page";
|
||||
@@ -21,7 +22,11 @@ export const ONBOARDING_SURFACE_ID = "window:onboarding";
|
||||
* closing it early leaves onboarding due.
|
||||
*/
|
||||
export function createOnboardingAppWindow(options: InProcessAppOptions): InProcessWindow {
|
||||
const pages: OnboardingPage[] = [new WelcomePage(), new TextSizePage(), new DataCollectionPage()];
|
||||
const pages: OnboardingPage[] = [
|
||||
new WelcomePage(), new TextSizePage(),
|
||||
...(global.isIOS ? [new IosPrivacyPage()] : []),
|
||||
new DataCollectionPage(),
|
||||
];
|
||||
const app = createInProcessWindow({
|
||||
appId: ONBOARDING_APP_ID,
|
||||
windowId: ONBOARDING_WINDOW_ID,
|
||||
|
||||
Reference in new issue
Block a user