forked from Blendman974/faceclaw
[verified] merge upstream c162c8e6 into all-features
This commit is contained in:
commit
5790e98d27
176 files changed
+5311
-2307
No files matched your search
@@ -15,9 +15,7 @@ import {
|
||||
type View,
|
||||
} from "@nativescript/core";
|
||||
import { dashboardController, type MirrorTouchKind } from "../g2/dashboard-controller";
|
||||
import { formatBatteryLine } from "../g2/glasses-display-state";
|
||||
import {
|
||||
glassesModelName,
|
||||
mirrorTouchSetting,
|
||||
onAnySettingChanged,
|
||||
showBleBandwidthSetting,
|
||||
@@ -28,7 +26,6 @@ import { isAutoReconnectSuppressed, resumeAutoReconnect } from "../g2/reconnect-
|
||||
import { isPreviewOnlyMode } from "./onboarding-state";
|
||||
import { formatErrorMessage } from "../util/format-error";
|
||||
import { screenHeight, screenWidth } from "../ui/shell/geometry";
|
||||
import { type PhoneUiButton } from "../apps/evenhub/manager";
|
||||
|
||||
/** The paired glasses' screen aspect (4:3 on the G2, 27:11 on the RayNeo iO). */
|
||||
function lensAspectRatio(): number {
|
||||
@@ -69,7 +66,6 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
private _alarmReliabilityMessage = "";
|
||||
private _warningsModalVisible = false;
|
||||
private _previewMode = false;
|
||||
private _evenHubPhoneUi: PhoneUiButton | null = null;
|
||||
private _phase: "disconnected" | "connecting" | "connected" | "charging" | "disconnecting" = "disconnected";
|
||||
|
||||
// A new view model is built on every navigation to the main page; these
|
||||
@@ -79,6 +75,7 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.showEvenHubPhoneUi = (windowId) => dashboardController.showEvenHubPhoneUi(windowId);
|
||||
this.attach();
|
||||
}
|
||||
|
||||
@@ -97,11 +94,6 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
this.displayPreviewMessage = snapshot.displayPreviewMessage;
|
||||
this.silentModeFeedback = snapshot.silentModeFeedback ?? "";
|
||||
this.phase = snapshot.phase;
|
||||
this.batteryLine = formatBatteryLine(
|
||||
snapshot.batteries,
|
||||
snapshot.phase === "connected" || snapshot.phase === "charging",
|
||||
glassesModelName(),
|
||||
);
|
||||
this.activeTextSettingId = snapshot.activeTextSettingId;
|
||||
this.activeTextEditorTitle = snapshot.activeTextEditorTitle;
|
||||
this.activeTextSettingTitle = snapshot.activeTextSettingTitle;
|
||||
@@ -128,9 +120,11 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
this.evenHubPhoneUi = snapshot.evenHubPhoneUi;
|
||||
this.refreshPadFocusLine();
|
||||
}));
|
||||
// Brightness / display mode can change from the glasses' Settings app too.
|
||||
// The input style can change from the glasses' Settings app too, and the
|
||||
// subscription delivers no snapshot of its own: catch up on a re-attach.
|
||||
this.refreshInputStyle();
|
||||
this.unsubscribers.push(onAnySettingChanged(() => {
|
||||
this.refreshDisplayControls();
|
||||
this.refreshInputStyle();
|
||||
this.syncBleBandwidthPolling();
|
||||
}));
|
||||
this.syncBleBandwidthPolling();
|
||||
@@ -343,7 +337,7 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
this.notifyPropertyChange("activeTextSettingId", value);
|
||||
this.notifyPropertyChange("textSettingEditorVisibility", this.textSettingEditorVisibility);
|
||||
this.notifyPropertyChange("isTextSettingEditorActive", this.isTextSettingEditorActive);
|
||||
// Keyboard-input mode: the tabbed controls make way for the editor.
|
||||
// Keyboard-input mode: the controls make way for the editor.
|
||||
this.notifyPropertyChange("controlsVisibility", this.controlsVisibility);
|
||||
}
|
||||
}
|
||||
@@ -514,7 +508,7 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
return this.isTextSettingEditorActive ? "visible" : "collapse";
|
||||
}
|
||||
|
||||
// ---- keyboard-input panel (the keyboard button beside the mic button) ----
|
||||
// ---- keyboard-input panel (the keyboard button under the mirror) ----
|
||||
//
|
||||
// The dialog lives on the glasses (ui/shell/keyboard-input.ts); the panel
|
||||
// is the phone's end of it, bound to keyboardInputModel (shared with iOS).
|
||||
@@ -744,28 +738,6 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
return this._warningsModalVisible ? "visible" : "collapse";
|
||||
}
|
||||
|
||||
set evenHubPhoneUi(value: PhoneUiButton | null) {
|
||||
const current = this._evenHubPhoneUi;
|
||||
if (current?.windowId === value?.windowId && current?.icon === value?.icon) return;
|
||||
this._evenHubPhoneUi = value;
|
||||
this.notifyPropertyChange("evenHubPhoneUiIcon", this.evenHubPhoneUiIcon);
|
||||
this.notifyPropertyChange("evenHubPhoneUiVisibility", this.evenHubPhoneUiVisibility);
|
||||
}
|
||||
|
||||
/** The foreground EvenHub app's icon, which opens its phone UI when tapped. */
|
||||
get evenHubPhoneUiIcon(): ImageSource | null {
|
||||
return this._evenHubPhoneUi?.icon ?? null;
|
||||
}
|
||||
|
||||
get evenHubPhoneUiVisibility(): "visible" | "collapse" {
|
||||
return this._evenHubPhoneUi?.icon ? "visible" : "collapse";
|
||||
}
|
||||
|
||||
onEvenHubPhoneUiTap(): void {
|
||||
const windowId = this._evenHubPhoneUi?.windowId;
|
||||
if (windowId) dashboardController.showEvenHubPhoneUi(windowId);
|
||||
}
|
||||
|
||||
onWarningIconTap(): void {
|
||||
this.setWarningsModalVisible(true);
|
||||
}
|
||||
@@ -1082,7 +1054,7 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
// ---- the phone's own controller: touchpad, d-pad, mirror touch ----
|
||||
//
|
||||
// Everything here is the watch scheme (origin "watch"): spatial swipes,
|
||||
// tap = select, double-tap / two fingers = back, hold = menu. The ring row
|
||||
// tap = select, double-tap / two fingers = back, hold = menu. The ring pad
|
||||
// above stays on the ring's own scheme.
|
||||
|
||||
private padTwoFingerDown = false;
|
||||
@@ -1213,11 +1185,11 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
return this.mirrorGesture(swipeKind(args.direction), args);
|
||||
}
|
||||
|
||||
// ---- the tabbed controls area below the mirror ----
|
||||
// ---- the controls area below the mirror ----
|
||||
//
|
||||
// Three tabs: Settings (screen size + brightness), Watch (the simulated
|
||||
// watch face), Ring (simulated R1 inputs). The whole area collapses while a
|
||||
// text setting is being edited so the editor gets the space instead.
|
||||
// The button bar and the touchpad (remote-controls.xml). The whole area
|
||||
// collapses while a text setting is being edited or the keyboard dialog is
|
||||
// up, so the editor gets the space instead.
|
||||
|
||||
get controlsVisibility(): "visible" | "collapse" {
|
||||
return this.isTextSettingEditorActive || this._keyboardInputActive ? "collapse" : "visible";
|
||||
@@ -1226,7 +1198,7 @@ export class MainViewModel extends RemoteControlsViewModel {
|
||||
// ---- BLE bandwidth indicator (Settings > Developer > Show BLE bandwidth usage) ----
|
||||
//
|
||||
// A running total of outbound BLE messages/bytes, overlaid at the bottom of
|
||||
// the page on every tab. Polled from the Java-side counters while enabled.
|
||||
// the page. Polled from the Java-side counters while enabled.
|
||||
|
||||
private _bleBandwidthLabel = "";
|
||||
private bleBandwidthTimer: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
Reference in new issue
Block a user