Phone UI: Settings are a page instead of a tab, watch vs ring style input is a setting rather than a tab, EvenHub webview is a button with the main buttons rather than in the top bar

This commit is contained in:
James Babcock committed 2026-11-12 12:16:33 -08:00
1 parent a02b849200
commit cd61fefb21
35 files changed
+848 -429

No files matched your search

+44 -54
View File
@@ -1,80 +1,70 @@
<!--
The phone's controller for the glasses, as a three-tab area below the mirror:
Settings (display mode, brightness and battery levels), Watch (the
simulated watch face: same scheme as the watch pad - tap = select,
double-tap or two fingers = back, hold = menu, swipes navigate), and Ring
(a touchpad on the ring's own scheme: vertical swipes scroll,
tap/double-tap/hold = click/double-click/long-press). Tap-then-hold on either pad is the G2 system-menu gesture. The
narrow mic and keyboard buttons at the tab bar's right edge fire the
wakeword / open the keyboard dialog without changing the selected tab. Used
by main-page.xml in both orientations; binds to the page's MainViewModel,
which collapses the whole area while a text setting is being edited or the
keyboard dialog is up (keyboard-input mode).
The phone's controller for the glasses, below the mirror: a bar of icon
buttons over a touchpad.
The root is a rows="auto,*" grid so the active section can use the leftover
height (the Watch face centers in it); the three sections share the star
cell, only one visible at a time.
The buttons are right-aligned: the foreground EvenHub app's phone UI (shown
only while such an app is in front; leftmost, so its coming and going moves
none of the others), voice input (fires the wakeword), the keyboard dialog,
and Settings (the phone's settings page: display mode, brightness, battery
levels, input style).
The touchpad imitates the device picked by Settings > Phone input style.
Watch is the simulated watch face, on the watch pad's scheme: tap = select,
double-tap or two fingers = back, hold = menu, swipes navigate. Ring is a
touchpad on the ring's own scheme: vertical swipes scroll, tap/double-tap/
hold = click/double-click/long-press. Tap-then-hold on either pad is the G2
system-menu gesture.
Used by main-page.xml in both orientations on Android and loaded by
main-page.ios.ts; binds to a RemoteControlsViewModel (Android's
MainViewModel extends it). The host collapses the whole area while a text
setting is being edited or the keyboard dialog is up (keyboard-input mode).
The root is a rows="auto,*" grid so the pad can use the leftover height (it
centers in it); the two pads share the star cell, only one visible at a time.
-->
<GridLayout xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:android="http://schemas.nativescript.org/tns.xsd" rows="auto,*" class="remote-controls">
<!-- rows="auto" everywhere below: a rows-less GridLayout's implicit row
acts as star, and this component sits in a bounded (star-row) parent,
where that would balloon the first grid to fill all remaining height. -->
<GridLayout row="0" rows="auto" columns="*,*,*,auto,auto" class="controls-tab-bar">
<Button col="0" text="Settings" textWrap="false" tap="{{ onSettingsTabTap }}" class="{{ settingsTabClass }}" />
<Button col="1" text="Watch" textWrap="false" tap="{{ onWatchTabTap }}" class="{{ watchTabClass }}" />
<Button col="2" text="Ring" textWrap="false" tap="{{ onRingTabTap }}" class="{{ ringTabClass }}" />
<!-- rows="auto": a rows-less GridLayout's implicit row acts as star, and
this component sits in a bounded (star-row) parent, where that would
balloon the bar to fill all remaining height. The star column takes the
slack, so the buttons hug the right edge: the watch face's, since the
bar is as wide as that pad and centered like it. -->
<GridLayout row="0" rows="auto" columns="*,auto,auto,auto,auto" width="{{ watchFaceWidth }}" horizontalAlignment="center" class="control-bar">
<!-- A Button can't hold an image, so these are button-styled tiles. The
explicit star row makes the cell fill the tile's height so the icon's
center alignment has room to work in. -->
<GridLayout col="3" rows="*" accessible="true" accessibilityRole="button" accessibilityLabel="Voice input" tap="{{ onSyntheticMicTap }}" class="tab-button tab-icon-button">
<Image src="res://ic_tab_mic" class="tab-icon" verticalAlignment="center" horizontalAlignment="center" />
<GridLayout col="1" rows="*" accessible="true" accessibilityRole="button" accessibilityLabel="{{ evenHubPhoneUiLabel }}" tap="{{ onEvenHubPhoneUiTap }}" visibility="{{ evenHubPhoneUiVisibility }}" class="control-button">
<Image src="{{ evenHubPhoneUiIcon }}" class="control-icon" verticalAlignment="center" horizontalAlignment="center" />
</GridLayout>
<GridLayout col="4" rows="*" accessible="true" accessibilityRole="button" accessibilityLabel="Keyboard input" tap="{{ onKeyboardTap }}" class="tab-button tab-icon-button">
<Image src="res://ic_tab_keyboard" class="tab-icon" verticalAlignment="center" horizontalAlignment="center" />
<GridLayout col="2" rows="*" accessible="true" accessibilityRole="button" accessibilityLabel="Voice input" tap="{{ onSyntheticMicTap }}" class="control-button">
<Image src="res://ic_control_mic" class="control-icon" verticalAlignment="center" horizontalAlignment="center" />
</GridLayout>
<GridLayout col="3" rows="*" accessible="true" accessibilityRole="button" accessibilityLabel="Keyboard input" tap="{{ onKeyboardTap }}" class="control-button">
<Image src="res://ic_control_keyboard" class="control-icon" verticalAlignment="center" horizontalAlignment="center" />
</GridLayout>
<GridLayout col="4" rows="*" accessible="true" accessibilityRole="button" accessibilityLabel="Settings" tap="{{ onSettingsTap }}" class="control-button control-button-last">
<Image src="res://ic_control_settings" class="control-icon" verticalAlignment="center" horizontalAlignment="center" />
</GridLayout>
</GridLayout>
<GridLayout row="1" layoutChanged="{{ onControlsContentLayoutChanged }}">
<!-- Settings tab -->
<StackLayout visibility="{{ settingsTabVisibility }}">
<GridLayout rows="auto" columns="auto,*" class="settings-row">
<Label col="0" text="Display mode" class="settings-row-label" verticalAlignment="center" />
<Button col="1" text="{{ displayModeLabel }}" tap="{{ onDisplayModeTap }}" class="mode-button" horizontalAlignment="left" />
</GridLayout>
<GridLayout rows="auto" columns="auto,*,auto" class="settings-row">
<Label col="0" text="☀" class="brightness-icon" verticalAlignment="center" />
<Slider col="1" width="100%" minValue="2" maxValue="100" value="{{ brightnessPercent }}" valueChange="{{ onBrightnessChange }}" isEnabled="{{ brightnessSliderEnabled }}" />
<StackLayout col="2" orientation="horizontal" verticalAlignment="center" class="auto-toggle">
<Label text="Auto" verticalAlignment="center" />
<Switch checked="{{ brightnessAuto }}" checkedChange="{{ onBrightnessAutoChange }}" />
</StackLayout>
</GridLayout>
<!-- Last-known levels of the glasses, their charging case and the R1;
collapsed until one is known. Last so its appearing doesn't move
the controls above. -->
<GridLayout rows="auto" columns="auto,*" class="settings-row" visibility="{{ batteryLineVisibility }}">
<Label col="0" text="Battery" class="settings-row-label" verticalAlignment="center" />
<Label col="1" text="{{ batteryLine }}" textWrap="true" class="settings-battery-line" verticalAlignment="center" />
</GridLayout>
</StackLayout>
<!-- Watch tab: centered in the leftover height, capped at the 1.5:1 face
<!-- Watch: centered in the leftover height, capped at the 1.5:1 face
aspect (watchFaceWidth = min(available, 1.5 x face height). The star
rows center the status line, plus the wake hint under it while the
display is off (a double-tap is the only gesture that wakes it), or
the charging case's level while the glasses charge in it. -->
<GridLayout visibility="{{ watchTabVisibility }}" width="{{ watchFaceWidth }}" height="{{ watchFaceHeight }}" rows="*,auto,auto,auto,*" horizontalAlignment="center" verticalAlignment="center" class="touchpad" android:tap="{{ onPadTap }}" android:doubleTap="{{ onPadDoubleTap }}" android:longPress="{{ onPadLongPress }}" android:swipe="{{ onPadSwipe }}" touch="{{ onPadTouch }}">
<GridLayout visibility="{{ watchPadVisibility }}" width="{{ watchFaceWidth }}" height="{{ watchFaceHeight }}" rows="*,auto,auto,auto,*" horizontalAlignment="center" verticalAlignment="center" class="touchpad" android:tap="{{ onPadTap }}" android:doubleTap="{{ onPadDoubleTap }}" android:longPress="{{ onPadLongPress }}" android:swipe="{{ onPadSwipe }}" touch="{{ onPadTouch }}">
<Label row="1" isUserInteractionEnabled="false" text="{{ padFocusLine }}" class="{{ padFocusClass }}" horizontalAlignment="center" />
<Label row="2" isUserInteractionEnabled="false" text="●● wake" visibility="{{ padWakeHintVisibility }}" class="pad-wake-hint" horizontalAlignment="center" />
<Label row="3" isUserInteractionEnabled="false" text="{{ padDetailLine }}" visibility="{{ padDetailVisibility }}" class="pad-detail" horizontalAlignment="center" />
</GridLayout>
<!-- Ring tab: a touchpad on the ring's own scheme. Vertical swipes only
(the ring has no horizontal axis) and no focus/status line; portrait
like the ring's pad itself. The auto rows hold the cosmetic markings the
<!-- Ring: a touchpad on the ring's own scheme. Vertical swipes only (the
ring has no horizontal axis) and no focus/status line; portrait like
the ring's pad itself. The auto rows hold the cosmetic markings the
physical ring has on its touch strip (they don't take touches); the star
rows are the seven equal gaps around them, edges included. -->
<GridLayout visibility="{{ ringTabVisibility }}" height="{{ ringTouchpadHeight }}" class="touchpad ring-touchpad"
<GridLayout visibility="{{ ringPadVisibility }}" height="{{ ringTouchpadHeight }}" class="touchpad ring-touchpad"
rows="*,auto,*,auto,*,auto,*,auto,*,auto,*,auto,*"
horizontalAlignment="center" verticalAlignment="center"
android:tap="{{ onRingPadTap }}" android:doubleTap="{{ onRingPadDoubleTap }}"