forked from Blendman974/faceclaw
Merge pull request #16 from jimrandomh/onboarding-flow-fixes
Various fixes to the onboarding flow
This commit is contained in:
22 files changed
+578
-87
No files matched your search
+11
-40
@@ -26,6 +26,10 @@ import java.util.concurrent.TimeUnit;
|
||||
* protobuf helpers (BleProtocol), but owns its own GATT connection and runs its
|
||||
* whole lifecycle on a single worker thread. It expects the main app to be
|
||||
* disconnected while it runs (onboarding, before flashing).
|
||||
*
|
||||
* Only the right arm is used: the lenses relay messages to each other, so
|
||||
* anything sent to the right arm reaches both, and acks/events only ever come
|
||||
* from the right arm anyway.
|
||||
*/
|
||||
public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
private static final String TAG = "FaceclawFlashPrompt";
|
||||
@@ -43,7 +47,6 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
|
||||
private final Context context;
|
||||
private final String rightAddress;
|
||||
private final String leftAddress;
|
||||
private final String warningText;
|
||||
private final FaceclawBleManager bleManager;
|
||||
private final Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||
@@ -58,7 +61,6 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
private volatile boolean cancelled = false;
|
||||
private volatile boolean finished = false;
|
||||
private volatile boolean rightConnected = false;
|
||||
private volatile boolean leftConnected = false;
|
||||
private volatile boolean rightLost = false;
|
||||
private volatile Boolean approved = null;
|
||||
private volatile ScheduledExecutorService heartbeatExecutor;
|
||||
@@ -66,10 +68,9 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
private int nextMagic = 100;
|
||||
private int nextSeq = 0x40;
|
||||
|
||||
public FaceclawFlashPromptCommunicator(Context context, String rightAddress, String leftAddress, String warningText) {
|
||||
public FaceclawFlashPromptCommunicator(Context context, String rightAddress, String warningText) {
|
||||
this.context = context.getApplicationContext();
|
||||
this.rightAddress = rightAddress == null ? "" : rightAddress;
|
||||
this.leftAddress = leftAddress == null ? "" : leftAddress;
|
||||
this.warningText = warningText == null ? "" : warningText;
|
||||
this.bleManager = new FaceclawBleManager(this.context);
|
||||
this.bleManager.setListener(this);
|
||||
@@ -116,18 +117,8 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
}
|
||||
|
||||
emitState("connecting", "");
|
||||
connectArm(rightAddress, "right");
|
||||
connectArm(rightAddress);
|
||||
rightConnected = true;
|
||||
|
||||
boolean haveLeft = !leftAddress.trim().isEmpty() && !leftAddress.equalsIgnoreCase(rightAddress);
|
||||
if (haveLeft) {
|
||||
try {
|
||||
connectArm(leftAddress, "left");
|
||||
leftConnected = true;
|
||||
} catch (Exception e) {
|
||||
emitLog("left arm connect failed (continuing on right only): " + e.getMessage());
|
||||
}
|
||||
}
|
||||
if (cancelled) {
|
||||
teardown();
|
||||
return;
|
||||
@@ -135,14 +126,6 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
|
||||
emitState("connected", "");
|
||||
bringUpArm(rightAddress);
|
||||
if (leftConnected) {
|
||||
try {
|
||||
bringUpArm(leftAddress);
|
||||
} catch (Exception e) {
|
||||
emitLog("left arm prompt failed (continuing on right only): " + e.getMessage());
|
||||
leftConnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
startHeartbeat();
|
||||
emitState("prompting", "");
|
||||
@@ -158,7 +141,7 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
if (approved != null) {
|
||||
boolean result = Boolean.TRUE.equals(approved);
|
||||
try {
|
||||
sendShutdownBoth();
|
||||
sendShutdown();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
emitResult(result);
|
||||
@@ -182,7 +165,7 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void connectArm(String address, String labelForLog) {
|
||||
private void connectArm(String address) {
|
||||
if (!bleManager.connect(address, ConnectionOptions.CONNECT_TIMEOUT_MS)) {
|
||||
throw new IllegalStateException("connect failed: " + address);
|
||||
}
|
||||
@@ -194,7 +177,7 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
if (!bleManager.enableNotifications(address, BleProtocol.NOTIFY_CHAR_UUID, true, ConnectionOptions.DESCRIPTOR_TIMEOUT_MS)) {
|
||||
throw new IllegalStateException("enableNotifications failed: " + address);
|
||||
}
|
||||
emitLog("connected " + labelForLog + " arm");
|
||||
emitLog("connected right arm");
|
||||
}
|
||||
|
||||
private void bringUpArm(String address) throws InterruptedException {
|
||||
@@ -301,9 +284,6 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
if (rightConnected) {
|
||||
writeFrame(rightAddress, BleProtocol.SID_EVENHUB, BleProtocol.FLAG_REQUEST, heartbeat);
|
||||
}
|
||||
if (leftConnected) {
|
||||
writeFrame(leftAddress, BleProtocol.SID_EVENHUB, BleProtocol.FLAG_REQUEST, heartbeat);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "heartbeat failed: " + e.getMessage());
|
||||
}
|
||||
@@ -317,14 +297,11 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void sendShutdownBoth() {
|
||||
private void sendShutdown() {
|
||||
byte[] shutdown = BleProtocol.buildShutdown(allocMagic(), 0);
|
||||
if (rightConnected) {
|
||||
writeFrame(rightAddress, BleProtocol.SID_EVENHUB, BleProtocol.FLAG_REQUEST, shutdown);
|
||||
}
|
||||
if (leftConnected) {
|
||||
writeFrame(leftAddress, BleProtocol.SID_EVENHUB, BleProtocol.FLAG_REQUEST, shutdown);
|
||||
}
|
||||
}
|
||||
|
||||
private void teardown() {
|
||||
@@ -335,7 +312,6 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
rightConnected = false;
|
||||
leftConnected = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -355,10 +331,7 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
return;
|
||||
}
|
||||
if (frame.flag == BleProtocol.FLAG_NOTIFY || frame.flag == BleProtocol.FLAG_NOTIFY_ALT) {
|
||||
// Async events (taps/selections) only ever come from the right arm.
|
||||
if (address.equalsIgnoreCase(rightAddress)) {
|
||||
handleEvent(frame);
|
||||
}
|
||||
handleEvent(frame);
|
||||
return;
|
||||
}
|
||||
if (frame.msgSeq >= 0) {
|
||||
@@ -407,8 +380,6 @@ public class FaceclawFlashPromptCommunicator implements FaceclawBleListener {
|
||||
selectionLatch.countDown();
|
||||
}
|
||||
}
|
||||
} else if (address.equalsIgnoreCase(leftAddress)) {
|
||||
leftConnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+56
@@ -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
|
||||
@@ -199,6 +224,29 @@ Button.pairing-link {
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Permissions screen (phone-ui/permissions-page). Cards reuse the pairing-row
|
||||
* / pairing-title / pairing-badge look above; these add the explanation body
|
||||
* and the already-granted checkmark.
|
||||
*/
|
||||
.permissions-description {
|
||||
font-size: 13;
|
||||
color: #555555;
|
||||
margin-top: 2;
|
||||
}
|
||||
|
||||
.permissions-check {
|
||||
font-size: 24;
|
||||
color: #2e7d32;
|
||||
margin-left: 10;
|
||||
}
|
||||
|
||||
/* Continue with required permissions still missing: looks disabled but stays
|
||||
* tappable (the tap raises an are-you-sure prompt instead of being ignored). */
|
||||
Button.permissions-primary-dimmed {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dark-mode pairing page. The cards keep their light-mode look above; here
|
||||
* they go dark-gray, and every text colour set above gets a light counterpart
|
||||
@@ -277,3 +325,11 @@ Button.pairing-link {
|
||||
.ns-dark Button.pairing-link {
|
||||
color: #7da7f5;
|
||||
}
|
||||
|
||||
.ns-dark .permissions-description {
|
||||
color: #b0b0b0;
|
||||
}
|
||||
|
||||
.ns-dark .permissions-check {
|
||||
color: #7bc47f;
|
||||
}
|
||||
@@ -5,6 +5,8 @@ const VOICE_PERMISSION_REQUEST_CODE = 4243;
|
||||
const CALENDAR_PERMISSION_REQUEST_CODE = 4244;
|
||||
const LOCATION_PERMISSION_REQUEST_CODE = 4245;
|
||||
const FINE_LOCATION_PERMISSION_REQUEST_CODE = 4246;
|
||||
const BLE_ONLY_PERMISSION_REQUEST_CODE = 4247;
|
||||
const POST_NOTIFICATIONS_PERMISSION_REQUEST_CODE = 4248;
|
||||
const POST_NOTIFICATIONS_PERMISSION = "android.permission.POST_NOTIFICATIONS";
|
||||
const RECORD_AUDIO_PERMISSION = "android.permission.RECORD_AUDIO";
|
||||
const READ_CALENDAR_PERMISSION = "android.permission.READ_CALENDAR";
|
||||
@@ -31,23 +33,22 @@ function toJavaStringArray(values: string[]): string[] {
|
||||
return result;
|
||||
}
|
||||
|
||||
function getRequiredPermissions(): string[] {
|
||||
const sdk = android.os.Build.VERSION.SDK_INT;
|
||||
const permissions: string[] = [];
|
||||
|
||||
if (sdk >= 31) {
|
||||
permissions.push(
|
||||
/** The runtime permissions this Android version needs for BLE scan + connect. */
|
||||
function getBlePermissions(): string[] {
|
||||
if (android.os.Build.VERSION.SDK_INT >= 31) {
|
||||
return [
|
||||
android.Manifest.permission.BLUETOOTH_SCAN,
|
||||
android.Manifest.permission.BLUETOOTH_CONNECT,
|
||||
);
|
||||
} else {
|
||||
permissions.push(android.Manifest.permission.ACCESS_FINE_LOCATION);
|
||||
];
|
||||
}
|
||||
return [android.Manifest.permission.ACCESS_FINE_LOCATION];
|
||||
}
|
||||
|
||||
if (sdk >= 33) {
|
||||
function getRequiredPermissions(): string[] {
|
||||
const permissions = getBlePermissions();
|
||||
if (android.os.Build.VERSION.SDK_INT >= 33) {
|
||||
permissions.push(POST_NOTIFICATIONS_PERMISSION);
|
||||
}
|
||||
|
||||
return permissions;
|
||||
}
|
||||
|
||||
@@ -107,6 +108,69 @@ export async function ensureVoicePermissions(): Promise<void> {
|
||||
await ensurePermissions([RECORD_AUDIO_PERMISSION], VOICE_PERMISSION_REQUEST_CODE, "Voice control");
|
||||
}
|
||||
|
||||
/** Whether the BLE scan/connect permissions have been granted (false off-Android). */
|
||||
export function hasBlePermissions(): boolean {
|
||||
if (!global.isAndroid) return false;
|
||||
return getBlePermissions().every((permission) => isPermissionGranted(permission));
|
||||
}
|
||||
|
||||
/**
|
||||
* Prompt for just the BLE permissions (without POST_NOTIFICATIONS, which the
|
||||
* Permissions screen presents as its own card). Resolves true when granted.
|
||||
*/
|
||||
export async function requestBlePermissions(): Promise<boolean> {
|
||||
if (!global.isAndroid) return false;
|
||||
try {
|
||||
await ensurePermissions(getBlePermissions(), BLE_ONLY_PERMISSION_REQUEST_CODE, "Bluetooth");
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether posting notifications is allowed. Before Android 13 (sdk 33) there
|
||||
* is no runtime permission for this, so it reports as granted.
|
||||
*/
|
||||
export function hasPostNotificationsPermission(): boolean {
|
||||
if (!global.isAndroid) return false;
|
||||
if (android.os.Build.VERSION.SDK_INT < 33) return true;
|
||||
return isPermissionGranted(POST_NOTIFICATIONS_PERMISSION);
|
||||
}
|
||||
|
||||
/** Prompt for POST_NOTIFICATIONS. Resolves true when the permission is held afterward. */
|
||||
export async function requestPostNotificationsPermission(): Promise<boolean> {
|
||||
if (!global.isAndroid) return false;
|
||||
if (android.os.Build.VERSION.SDK_INT < 33) return true;
|
||||
try {
|
||||
await ensurePermissions(
|
||||
[POST_NOTIFICATIONS_PERMISSION],
|
||||
POST_NOTIFICATIONS_PERMISSION_REQUEST_CODE,
|
||||
"Notification",
|
||||
);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Whether RECORD_AUDIO has been granted (false off-Android). */
|
||||
export function hasMicrophonePermission(): boolean {
|
||||
if (!global.isAndroid) return false;
|
||||
return isPermissionGranted(RECORD_AUDIO_PERMISSION);
|
||||
}
|
||||
|
||||
/** Prompt for RECORD_AUDIO. Resolves true when granted, false on denial. */
|
||||
export async function requestMicrophonePermission(): Promise<boolean> {
|
||||
if (!global.isAndroid) return false;
|
||||
try {
|
||||
await ensureVoicePermissions();
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Whether READ_CALENDAR has been granted (false off-Android). */
|
||||
export function hasCalendarPermission(): boolean {
|
||||
if (!global.isAndroid) return false;
|
||||
|
||||
@@ -17,6 +17,9 @@ export type FlashPromptState =
|
||||
* stock-firmware-compatible BLE path that shows the pre-flash confirmation on
|
||||
* the glasses and reports the user's Yes/No choice. Separate from
|
||||
* FaceclawCommunicatorBridge on purpose (different, minimal protocol subset).
|
||||
*
|
||||
* Talks to the right arm only: the lenses relay messages between themselves,
|
||||
* and acks/events always come from the right arm.
|
||||
*/
|
||||
export class FlashPromptCommunicator {
|
||||
private readonly communicator: any;
|
||||
@@ -25,14 +28,13 @@ export class FlashPromptCommunicator {
|
||||
private readonly stateListeners = new Set<(state: FlashPromptState, detail: string) => void>();
|
||||
private readonly resultListeners = new Set<(approved: boolean) => void>();
|
||||
|
||||
constructor(addresses: { right: string; left: string }, warningText: string) {
|
||||
constructor(rightAddress: string, warningText: string) {
|
||||
const context = Utils.android.getApplicationContext();
|
||||
if (!context) throw new Error("Android application context unavailable");
|
||||
|
||||
this.communicator = new com.faceclaw.app.FaceclawFlashPromptCommunicator(
|
||||
context,
|
||||
addresses.right,
|
||||
addresses.left,
|
||||
rightAddress,
|
||||
warningText,
|
||||
);
|
||||
this.listenerProxy = new com.faceclaw.app.FaceclawFlashPromptListener({
|
||||
|
||||
@@ -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" });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)`;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo">
|
||||
<ActionBar title="{{ title }}">
|
||||
<NavigationButton android.systemIcon="ic_menu_back" tap="{{ onBackTap }}" />
|
||||
</ActionBar>
|
||||
|
||||
<ScrollView>
|
||||
<Label text="{{ text }}" textWrap="true" class="document-text p-16" />
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -3,6 +3,7 @@
|
||||
<ActionItem text="{{ buttonLabel }}" tap="{{ onTap }}" isEnabled="{{ connectItemEnabled }}" android.position="popup" />
|
||||
<ActionItem text="Pair glasses" tap="{{ onPairGlassesTap }}" isEnabled="{{ canRun }}" android.position="popup" />
|
||||
<ActionItem text="Configure devices" tap="{{ onConfigureTap }}" isEnabled="{{ canRun }}" android.position="popup" />
|
||||
<ActionItem text="Permissions" tap="{{ onPermissionsTap }}" android.position="popup" />
|
||||
<ActionItem text="Take screenshot" tap="{{ onTakeScreenshotTap }}" android.position="popup" />
|
||||
<ActionItem text="Record screen" tap="{{ onRecordScreenTap }}" android.position="popup" />
|
||||
<ActionItem text="Uninstall custom firmware" tap="{{ onUninstallFirmwareTap }}" isEnabled="{{ canRun }}" android.position="popup" />
|
||||
|
||||
@@ -484,6 +484,13 @@ export class MainViewModel extends Observable {
|
||||
Frame.topmost()?.navigate("phone-ui/config-page");
|
||||
}
|
||||
|
||||
onPermissionsTap(): void {
|
||||
Frame.topmost()?.navigate({
|
||||
moduleName: "phone-ui/permissions-page",
|
||||
context: { onboarding: false },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Live scan that names each nearby pair by model, colour, and serial and
|
||||
* checks both arms belong together. A connected arm stops advertising, so
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -253,7 +253,7 @@ export class OnboardingFlashViewModel extends Observable {
|
||||
|
||||
private startCommunicator(addresses: { right: string; left: string }): void {
|
||||
this.disposePrompt();
|
||||
const prompt = new FlashPromptCommunicator(addresses, this.glassesWarning);
|
||||
const prompt = new FlashPromptCommunicator(addresses.right, this.glassesWarning);
|
||||
this.prompt = prompt;
|
||||
|
||||
this.promptUnsubscribers.push(
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import { EventData, Page } from "@nativescript/core";
|
||||
import { NavigatedData, Page } from "@nativescript/core";
|
||||
|
||||
import { OnboardingViewModel } from "./onboarding-view-model";
|
||||
|
||||
export function navigatingTo(args: EventData): void {
|
||||
type OnboardingContext = { step?: number } | undefined;
|
||||
|
||||
export function navigatingTo(args: NavigatedData): void {
|
||||
const page = args.object as Page;
|
||||
// Preserve the step when returning from the flashing page (back navigation
|
||||
// re-fires navigatingTo); only build a fresh model on first entry.
|
||||
// re-fires navigatingTo); only build a fresh model on first entry. The
|
||||
// permissions page navigates here with { step: 3 } to continue the flow.
|
||||
if (!page.bindingContext) {
|
||||
page.bindingContext = new OnboardingViewModel();
|
||||
const context = args.context as OnboardingContext;
|
||||
page.bindingContext = new OnboardingViewModel(context?.step);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" actionBarHidden="true">
|
||||
<GridLayout rows="*,auto" class="p-20">
|
||||
<GridLayout rows="*,auto,auto" class="p-20">
|
||||
<StackLayout row="0" verticalAlignment="middle" visibility="{{ splashVisibility }}">
|
||||
<Label text="{{ headline }}" class="h1 text-center" textWrap="true" />
|
||||
<Label text="{{ tagline }}" class="body-text text-center m-t-8" textWrap="true" />
|
||||
@@ -13,7 +13,13 @@
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
<GridLayout row="1" columns="*,*" class="m-t-20">
|
||||
<StackLayout row="1" orientation="horizontal" horizontalAlignment="center" class="m-t-16" visibility="{{ footerVisibility }}">
|
||||
<Label text="License (GPLv3)" class="footer-link" tap="{{ onLicenseTap }}" />
|
||||
<Label text="·" class="footer-link-separator" />
|
||||
<Label text="Privacy Policy" class="footer-link" tap="{{ onPrivacyTap }}" />
|
||||
</StackLayout>
|
||||
|
||||
<GridLayout row="2" columns="*,*" class="m-t-20">
|
||||
<Button col="0" text="{{ secondaryLabel }}" tap="{{ onSecondaryTap }}" visibility="{{ secondaryVisibility }}" />
|
||||
<Button col="1" text="{{ primaryLabel }}" tap="{{ onPrimaryTap }}" class="-primary" />
|
||||
</GridLayout>
|
||||
|
||||
@@ -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,
|
||||
@@ -50,8 +50,9 @@ const STEP_CONTENT: Record<OnboardingStep, StepContent> = {
|
||||
export class OnboardingViewModel extends Observable {
|
||||
private _step: OnboardingStep = 1;
|
||||
|
||||
constructor() {
|
||||
constructor(initialStep?: number) {
|
||||
super();
|
||||
if (initialStep === 2 || initialStep === 3) this._step = initialStep;
|
||||
this.publish();
|
||||
}
|
||||
|
||||
@@ -61,15 +62,33 @@ export class OnboardingViewModel extends Observable {
|
||||
return;
|
||||
}
|
||||
if (this._step === 2) {
|
||||
this.setStep(3);
|
||||
// The Permissions screen sits between the disclaimer and the firmware
|
||||
// step; it navigates forward to a fresh onboarding page at step 3.
|
||||
Frame.topmost()?.navigate({
|
||||
moduleName: "phone-ui/permissions-page",
|
||||
context: { onboarding: true },
|
||||
});
|
||||
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.
|
||||
// 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" });
|
||||
}
|
||||
|
||||
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/pairing-page",
|
||||
context: { onboarding: true },
|
||||
moduleName: "phone-ui/document-page",
|
||||
context: { fileName, title },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -134,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;
|
||||
@@ -150,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);
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { EventData, NavigatedData, Page } from "@nativescript/core";
|
||||
|
||||
import { PermissionsViewModel } from "./permissions-view-model";
|
||||
|
||||
type PermissionsContext = { onboarding?: boolean } | undefined;
|
||||
|
||||
export function navigatingTo(args: NavigatedData): void {
|
||||
const page = args.object as Page;
|
||||
// Preserve the model when returning via back navigation (from the step-3
|
||||
// onboarding page); statuses are re-checked in the loaded handler.
|
||||
if (!page.bindingContext) {
|
||||
const context = args.context as PermissionsContext;
|
||||
page.bindingContext = new PermissionsViewModel({ onboarding: context?.onboarding ?? false });
|
||||
}
|
||||
}
|
||||
|
||||
export function loaded(args: EventData): void {
|
||||
const page = args.object as Page;
|
||||
(page.bindingContext as PermissionsViewModel | undefined)?.onPageLoaded();
|
||||
}
|
||||
|
||||
export function unloaded(args: EventData): void {
|
||||
const page = args.object as Page;
|
||||
(page.bindingContext as PermissionsViewModel | undefined)?.onPageUnloaded();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" loaded="loaded" unloaded="unloaded" actionBarHidden="{{ actionBarHidden }}">
|
||||
<ActionBar title="Permissions" />
|
||||
|
||||
<GridLayout rows="auto,*,auto" class="p-16">
|
||||
<StackLayout row="0">
|
||||
<Label text="Permissions" class="h1 text-center" textWrap="true" visibility="{{ headlineVisibility }}" />
|
||||
<Label text="{{ instructions }}" class="m-t-8 pairing-instructions" textWrap="true" />
|
||||
</StackLayout>
|
||||
|
||||
<ScrollView row="1" class="m-t-12">
|
||||
<StackLayout>
|
||||
<Repeater items="{{ cards }}">
|
||||
<Repeater.itemsLayout>
|
||||
<StackLayout />
|
||||
</Repeater.itemsLayout>
|
||||
<Repeater.itemTemplate>
|
||||
<GridLayout columns="*,auto" rows="auto" class="pairing-row" tap="{{ onCardTap }}">
|
||||
<StackLayout col="0">
|
||||
<GridLayout columns="auto,auto">
|
||||
<Label col="0" text="{{ title }}" class="pairing-title" />
|
||||
<Label col="1" text="Optional" class="pairing-badge" marginLeft="14" visibility="{{ optionalVisibility }}" />
|
||||
</GridLayout>
|
||||
<Label text="{{ description }}" class="permissions-description" textWrap="true" />
|
||||
</StackLayout>
|
||||
<Label col="1" text="✓" class="permissions-check" verticalAlignment="center" visibility="{{ checkVisibility }}" />
|
||||
</GridLayout>
|
||||
</Repeater.itemTemplate>
|
||||
</Repeater>
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
<GridLayout row="2" columns="*,*" class="m-t-12">
|
||||
<Button col="0" text="Back" tap="{{ onSecondaryTap }}" visibility="{{ secondaryVisibility }}" />
|
||||
<Button col="1" text="{{ primaryLabel }}" tap="{{ onPrimaryTap }}" class="{{ primaryClass }}" />
|
||||
</GridLayout>
|
||||
</GridLayout>
|
||||
</Page>
|
||||
@@ -0,0 +1,243 @@
|
||||
import { Application, Dialogs, EventData, Frame, Observable, View } from "@nativescript/core";
|
||||
|
||||
import {
|
||||
ensureCalendarPermission,
|
||||
ensureFineLocationPermission,
|
||||
hasBlePermissions,
|
||||
hasCalendarPermission,
|
||||
hasFineLocationPermission,
|
||||
hasMicrophonePermission,
|
||||
hasPostNotificationsPermission,
|
||||
requestBlePermissions,
|
||||
requestMicrophonePermission,
|
||||
requestPostNotificationsPermission,
|
||||
} from "../g2/android-permissions";
|
||||
import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization";
|
||||
import { isNotificationListenerEnabled, requestNotificationListenerAccess } from "../native/notification-access";
|
||||
|
||||
type PermissionDefinition = {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
optional: boolean;
|
||||
isGranted: () => boolean;
|
||||
/** Show the grant UI: a runtime-permission dialog or a system settings screen. */
|
||||
request: () => void | Promise<unknown>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Battery Optimization and Read Notifications are not runtime permissions:
|
||||
* their request() opens a system screen, so the granted state can only be
|
||||
* re-checked when the app resumes (the page refreshes on Application.resume).
|
||||
*/
|
||||
const PERMISSIONS: PermissionDefinition[] = [
|
||||
{
|
||||
id: "nearby-devices",
|
||||
title: "Nearby Devices",
|
||||
description: "Needed to communicate with your smart glasses over Bluetooth.",
|
||||
optional: false,
|
||||
isGranted: hasBlePermissions,
|
||||
request: requestBlePermissions,
|
||||
},
|
||||
{
|
||||
id: "post-notifications",
|
||||
title: "Send Notifications",
|
||||
description: "A notification will be pinned, to keep Faceclaw running while your phone screen is off.",
|
||||
optional: false,
|
||||
isGranted: hasPostNotificationsPermission,
|
||||
request: requestPostNotificationsPermission,
|
||||
},
|
||||
{
|
||||
id: "battery-optimization",
|
||||
title: "Battery Optimization",
|
||||
description: "Needed to keep running while your phone screen is off.",
|
||||
optional: false,
|
||||
isGranted: isIgnoringBatteryOptimizations,
|
||||
request: requestIgnoreBatteryOptimizations,
|
||||
},
|
||||
{
|
||||
id: "read-notifications",
|
||||
title: "Read Notifications",
|
||||
description: "Needed to display your Android notifications on the glasses.",
|
||||
optional: true,
|
||||
isGranted: isNotificationListenerEnabled,
|
||||
request: requestNotificationListenerAccess,
|
||||
},
|
||||
{
|
||||
id: "microphone",
|
||||
title: "Microphone",
|
||||
description: "Needed to use voice input.",
|
||||
optional: true,
|
||||
isGranted: hasMicrophonePermission,
|
||||
request: requestMicrophonePermission,
|
||||
},
|
||||
{
|
||||
id: "location",
|
||||
title: "Location",
|
||||
description: "Needed to use location-based features like navigation inside glasses apps.",
|
||||
optional: true,
|
||||
// Navigation needs precise fixes, so the checkmark tracks fine location;
|
||||
// "approximate only" leaves the card unchecked and re-tappable.
|
||||
isGranted: hasFineLocationPermission,
|
||||
request: ensureFineLocationPermission,
|
||||
},
|
||||
{
|
||||
id: "calendar",
|
||||
title: "Calendar",
|
||||
description: "Needed to display your calendar on the glasses.",
|
||||
optional: true,
|
||||
isGranted: hasCalendarPermission,
|
||||
request: ensureCalendarPermission,
|
||||
},
|
||||
];
|
||||
|
||||
/** One Repeater card: the permission's copy plus the display-only fields the XML binds. */
|
||||
export type PermissionCardItem = {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
optionalVisibility: "visible" | "collapse";
|
||||
checkVisibility: "visible" | "collapse";
|
||||
onCardTap: (args: EventData) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* The Permissions screen: one card per Android permission Faceclaw uses, with
|
||||
* a checkmark when it is already granted and tap-to-grant otherwise. Reached
|
||||
* both from onboarding (between the disclaimer and the firmware step) and from
|
||||
* the main-screen menu.
|
||||
*/
|
||||
export class PermissionsViewModel extends Observable {
|
||||
private readonly onboarding: boolean;
|
||||
private _cards: PermissionCardItem[] = [];
|
||||
private requesting = false;
|
||||
|
||||
constructor(options?: { onboarding?: boolean }) {
|
||||
super();
|
||||
this.onboarding = options?.onboarding ?? false;
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Battery Optimization and Read Notifications grant flows leave the app for
|
||||
* a system screen; re-check everything whenever the app comes back.
|
||||
*/
|
||||
private readonly onAppResume = (): void => this.refresh();
|
||||
|
||||
onPageLoaded(): void {
|
||||
Application.on(Application.resumeEvent, this.onAppResume);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
onPageUnloaded(): void {
|
||||
Application.off(Application.resumeEvent, this.onAppResume);
|
||||
}
|
||||
|
||||
// --- observable properties -------------------------------------------------
|
||||
|
||||
get actionBarHidden(): boolean {
|
||||
return this.onboarding;
|
||||
}
|
||||
|
||||
get headlineVisibility(): "visible" | "collapse" {
|
||||
return this.onboarding ? "visible" : "collapse";
|
||||
}
|
||||
|
||||
get instructions(): string {
|
||||
return this.onboarding
|
||||
? "Faceclaw uses these Android permissions. Tap a card to grant one; a checkmark means it is already granted. " +
|
||||
"Optional permissions can also be granted later, from the Permissions item in the main-screen menu."
|
||||
: "Tap a card to grant a permission; a checkmark means it is already granted.";
|
||||
}
|
||||
|
||||
get cards(): PermissionCardItem[] {
|
||||
return this._cards;
|
||||
}
|
||||
|
||||
get primaryLabel(): string {
|
||||
return this.onboarding ? "Continue" : "Done";
|
||||
}
|
||||
|
||||
/**
|
||||
* Continue looks grayed out (but stays tappable — tapping it asks for
|
||||
* confirmation instead) while a required permission is missing. Done, in
|
||||
* menu mode, never dims: there is nothing to warn about when closing.
|
||||
*/
|
||||
get primaryClass(): string {
|
||||
return this.onboarding && !this.requiredPermissionsGranted()
|
||||
? "-primary permissions-primary-dimmed"
|
||||
: "-primary";
|
||||
}
|
||||
|
||||
get secondaryVisibility(): "visible" | "collapse" {
|
||||
return this.onboarding ? "visible" : "collapse";
|
||||
}
|
||||
|
||||
// --- actions ---------------------------------------------------------------
|
||||
|
||||
// Arrow property: NativeScript fires XML event handlers with `this` bound to
|
||||
// the tapped view's bindingContext (the card item), not the view model.
|
||||
readonly onCardTap = (args: EventData): void => {
|
||||
const item = (args.object as View).bindingContext as PermissionCardItem | undefined;
|
||||
if (!item || this.requesting) return;
|
||||
const definition = PERMISSIONS.find((permission) => permission.id === item.id);
|
||||
if (!definition || definition.isGranted()) return;
|
||||
void this.requestPermission(definition);
|
||||
};
|
||||
|
||||
async onPrimaryTap(): Promise<void> {
|
||||
if (this.onboarding) {
|
||||
if (!this.requiredPermissionsGranted()) {
|
||||
const proceed = await Dialogs.confirm({
|
||||
title: "Missing Permissions",
|
||||
message: "You haven't enabled all of the necessary permissions. Are you sure you want to continue?",
|
||||
okButtonText: "Continue",
|
||||
cancelButtonText: "Go Back",
|
||||
});
|
||||
if (!proceed) return;
|
||||
}
|
||||
// Continue the onboarding chain at the Custom Firmware Required step.
|
||||
Frame.topmost()?.navigate({
|
||||
moduleName: "phone-ui/onboarding-page",
|
||||
context: { step: 3 },
|
||||
});
|
||||
return;
|
||||
}
|
||||
Frame.topmost()?.goBack();
|
||||
}
|
||||
|
||||
onSecondaryTap(): void {
|
||||
Frame.topmost()?.goBack();
|
||||
}
|
||||
|
||||
// --- rendering -------------------------------------------------------------
|
||||
|
||||
private async requestPermission(definition: PermissionDefinition): Promise<void> {
|
||||
this.requesting = true;
|
||||
try {
|
||||
await definition.request();
|
||||
} catch {
|
||||
// A denial simply leaves the card unchecked; the user can tap again.
|
||||
} finally {
|
||||
this.requesting = false;
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private requiredPermissionsGranted(): boolean {
|
||||
return PERMISSIONS.every((definition) => definition.optional || definition.isGranted());
|
||||
}
|
||||
|
||||
refresh(): void {
|
||||
this._cards = PERMISSIONS.map((definition) => ({
|
||||
id: definition.id,
|
||||
title: definition.title,
|
||||
description: definition.description,
|
||||
optionalVisibility: definition.optional ? "visible" : "collapse",
|
||||
checkVisibility: definition.isGranted() ? "visible" : "collapse",
|
||||
onCardTap: this.onCardTap,
|
||||
}));
|
||||
this.notifyPropertyChange("cards", this._cards);
|
||||
this.notifyPropertyChange("primaryClass", this.primaryClass);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user