Refine the UI of the main screen bottom area

<details>
<summary>Prompts Used</summary>
Thanks. Next up, we're going to work on the main screen bottom input area.

We will have a distinct state for keyboard-input mode (ie when you select a setting with a text field). While in that state, we'll hide other inputs (ie the simulated watch and ring input buttons) and put the text input (which is currently a modal on top of the screen preview) in the space below the screen preview. If it doesn't fit, given the reduced screen height while the keyboard is open, it will overlap the screen preview. When leaving a text-input screen, we will close the keyboard.

When the keyboard isn't open, we will have a tab bar-style row of buttons underneath the screen preview, with three tabs: Settings, Watch, and Ring. The Settings tab will have brightness and screen size options (we will drop the options in the Phone Display section of the Settings app which would hide these settings). The Ring tab will have a set of buttons corresponding to simulated R1 ring inputs (the main page has recently had this, but currently doesn't seem to). The Watch tab will have a simulated watch face for simulated Android Wear watch inputs (this is currently on the main page).

> Done — builds and typechecks cleanly. Here's the shape of it:
>
> **Keyboard-input mode**
> - When a text setting becomes active, the whole tabbed controls area collapses (`controlsVisibility` on the `rc:remote-controls` instances in both orientations), leaving the space below the preview for the editor.
> - The text editor overlay is now anchored to the **bottom** of the page instead of the top. Combined with the keyboard resizing the page, it sits in the space below the preview and only rides up over the preview when the keyboard leaves too little room. To make that resize behavior deterministic, I added `android:windowSoftInputMode="adjustResize"` to the activity in the manifest (previously unset, so Android picked pan-vs-resize itself; note this applies app-wide, which is generally the better behavior for the other pages with text fields too).
> - When the glasses navigate away from the text-input screen (`activeTextSettingId` goes null), the page now dismisses the soft keyboard, and the tab area comes back.
>
> **Tab bar** (`remote-controls.xml` rewritten)
> - Three tabs — Settings, Watch, Ring — as a segmented row of buttons; the selected tab is remembered across page navigations (module-level, in-memory), defaulting to Watch.
> - **Settings**: screen-size picker (labeled row) and the brightness slider + Auto switch, now always shown.
> - **Watch**: the simulated watch face unchanged (touchpad with d-pad overlay and legend) plus the Back/Menu row.
> - **Ring**: a 3×2 grid of larger labeled buttons for the R1 inputs — ▲ Up, ▼ Down, ● Click, ●● Double, ‒ Hold, and Hey Even (the wakeword, which moved here from the old shared action row since it's a ring-scheme input).
>
> **Settings app**: `showBrightnessControlSetting` and `showScreenSizeSetting` are deleted outright (definitions, menu items, and the view-model visibility getters). The Phone display section keeps Preview color and Touch mirror. Users' old stored values for the deleted keys are simply orphaned, which is harmless.
>
> Things worth checking on hardware: the editor's position with the keyboard open (especially on a short screen where it should overlap the preview), keyboard dismissal when backing out of a text setting on the glasses, and dark-mode contrast of the tab buttons (I inverted the selected/unselected colors for `.ns-dark`).
<hr>
Keyboard-open view: Looks good. One minor (preexisting) issue: The input title (eg "Agent bridge port") appears twice.

Keyboard-closed view: It looks like the tabs are vertically centered when they should be closer to the screen preview; and, the tab contents don't seem to be visible at all.

> Both issues fixed, verified on the tablet, and the fixed build is installed on both devices.
>
> **Tab bar centered / contents invisible** — I reproduced it on the tablet and traced it with a native view-hierarchy dump. The visibility bindings and tab switching were actually working fine; the bug was a NativeScript layout quirk: a `GridLayout` with no `rows` attribute gets a single implicit row that behaves like `*` (star). The old page measured the controls inside an `auto` grid row (unbounded, so the star row collapsed to content), but the restructured page puts them in the outer grid's `*` row (bounded measure) — so the rows-less tab-bar grid ballooned to fill all remaining height, centered its buttons in the stretch, and left zero height for the tab contents below it. The fix is explicit `rows="auto"` on the tab bar, both Settings rows, and the Back/Menu row in `remote-controls.xml`. Verified all three tabs on-device: Watch shows the touchpad + Back/Menu, Settings shows the screen-size picker and brightness row, Ring shows the six input buttons, all sitting directly under the preview.
>
> **Duplicate input title** — for a single-field edit, the editor title and the field's own label are the same string (`editorTitle` defaults to the field label), and the page rendered both. The per-field label is now only shown when a second field exists (where the labels actually distinguish the fields); single-field edits show just the one heading.
>
> One thing I noticed but couldn't test while disconnected: the keyboard-mode change is untouched except for that label, so it should still look as you saw it. There's also a pre-existing console error on page load — `keyboardType="text"` is not a valid NativeScript keyboard type (only email/number/etc. are), so the binding logs an error and falls back to the default keyboard. Harmless, but the clean fix would be to leave `keyboardType` unset for plain text; happy to do that if you want.
<hr>
Thanks, that is now working. Next up let's add a microphone button to the tab bar, as the rightmost button. Use an icon rather than text, and make it narrower than the others. The button will leave the tab selection unchanged, and trigger as if the wakeword ("Hey Even") was spoken. This will replace the "Hey Even" button in the Ring section.

In the Watch section, we will vertically center the emulated-watch UI within the remaining space beneath the tab bar, and set a maximum width corresponding to an aspect ratio for the simulated watch face of 1.5:1.

> Done and verified on the tablet; both devices have the new build.
>
> **Mic button** — added as a fourth, narrower (56dp) column at the right end of the tab bar, showing the 🎤 emoji. It uses the plain tab style, never shows the selected state, and taps route to the existing `onSyntheticMicTap` (ring "wakeword"), leaving the tab selection untouched. The "Hey Even" button is gone from the Ring tab, which now has just the five ring inputs (Up / Down / Click on the top row, Double / Hold below).
>
> **Watch tab centering + aspect cap** — the component root is now a `rows="auto,*"` grid (tab bar on top, the three sections sharing the star cell), and the portrait page gives the controls the full star row (with Stop recording moved to an `auto` row beneath, so it still appears when recording). The watch section — face plus the Back/Menu row — is `verticalAlignment="center"` in the leftover height and width-capped at `min(available width, 1.5 × 230dp face height ≈ 345dp)` via a new `watchFaceWidth` getter that recomputes on orientation change (in landscape the side panel's 328dp effectively governs). Verified on the tablet: the face sits centered between the tab bar and screen bottom at the capped width, and Settings/Ring stay top-aligned.
>
> One aesthetic note: on the Samsung tablet the 🎤 emoji renders as a gray studio mic rather than a colorful one — legible, but if you'd rather have a crisper icon I could switch to a font-icon or a tinted drawable.
<hr>
Thanks. For the microphone button, let's use `~/Downloads/noun-microphone-1368757.svg`.

> Done — the mic button now uses your Noun Project SVG instead of the emoji, verified on the tablet and installed on both devices.
>
> Since NativeScript Buttons are text-only, I converted the SVG's two paths into an Android VectorDrawable (`App_Resources/Android/src/main/res/drawable/ic_tab_mic.xml`, with a comment crediting the source file) and made the mic control a button-styled GridLayout tile holding a tinted `Image`. It keeps the 56dp width and the `.tab-button` look, plus a small `android-elevation` so it casts the same shadow as the real MaterialButtons beside it. The icon tints `#333333` in light mode and `#cccccc` in dark mode via `tint-color`, matching the tab label colors, and the tap still fires the wakeword without touching tab selection.
>
> One licensing note: Noun Project icons are CC BY unless you have a Pro license — if you don't, the icon's creator should be credited somewhere user-visible (e.g. an about/credits page) before a public release.
<hr>
(I do have a Nounproject pro license)
Thanks, the icon renders correctly, but it's off-center (top and left rather than centered on both axes), and the height and drop shadow of the mic button now doesn't match the other buttons in the tab strip.

> Fixed and verified on the tablet; both devices have the build.
>
> Two things were wrong, both variations of the same NativeScript grid quirk from before:
>
> - **Off-center icon**: the tile's row was effectively auto-sized — row heights are locked in at measure time, and inside the tab bar's `auto` row the tile was measured unbounded, so its cell hugged the 20dp icon and the layout-time stretch dumped the leftover space below/right of it. Giving the tile an explicit `height: 48` bounds its measure, so its `rows="*"` cell genuinely fills and the icon's center alignments work — confirmed by native bounds (icon at exactly (72−30)/2 within the tile on both axes).
> - **Height/shadow mismatch**: MaterialButtons render 48dp tall inside a 60dp layout box (6dp built-in top/bottom insets), while the tile was stretching to the full 60dp row. It now gets `margin: 6 2` plus the 48dp height, so its edges and its elevation shadow align with the neighboring buttons.
>
> The 48dp is derived from the tab buttons' current font/padding metrics, so if the tab-button styling ever changes materially, that value would need to follow — I left a comment in `app.css` tying them together.
</details>
This commit is contained in:
James Babcock committed 2026-08-26 00:44:22 -07:00
1 parent b99aa85964
commit b9e5e56ac8
9 files changed
+247 -95

No files matched your search

@@ -77,6 +77,7 @@
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
android:windowSoftInputMode="adjustResize"
android:theme="@style/LaunchScreenTheme"
android:hardwareAccelerated="true"
android:launchMode="singleTask"
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Microphone icon for the main page's tab-bar wakeword button.
Converted from ~/Downloads/noun-microphone-1368757.svg (Noun Project
icon #1368757); base fill is overridden by tint-color in app.css. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="1200"
android:viewportHeight="1200">
<path
android:fillColor="#FF333333"
android:fillType="evenOdd"
android:pathData="m821.23 215.45v382.24c0 289.57-442.47 291.89-442.47 0v-382.24c0-287.26 442.47-287.26 442.47 0z" />
<path
android:fillColor="#FF333333"
android:fillType="evenOdd"
android:pathData="m543.24 963.71c-294.21-27.801-328.96-298.84-328.96-546.72 0-41.699 88.031-41.699 97.297-4.6328 2.3164 199.23 4.6328 454.05 287.26 454.05 284.94 0 287.26-254.83 287.26-454.05 6.9492-39.383 99.613-37.066 99.613 4.6328 0 247.88-34.75 518.92-333.59 546.72v139h152.89c67.18 0 69.5 97.297 0 97.297h-414.67c-64.863 0-62.547-97.297 0-97.297h152.89v-139z" />
</vector>
+57 -15
View File
@@ -159,8 +159,58 @@ Button.-primary {
.remote-controls {
margin: 0 8 0 8;
}
.display-controls {
margin-bottom: 6;
/* The Settings / Watch / Ring tab bar above the controls. */
.controls-tab-bar {
margin-bottom: 8;
}
.tab-button {
font-size: 14;
padding: 8 0;
margin: 0 2;
border-radius: 6;
background-color: #e2e2e2;
color: #333333;
}
.tab-button-selected {
background-color: #424242;
color: #ffffff;
}
/* The wakeword button at the tab bar's right edge: icon-only, narrower than
* the tabs, and never in the selected state (it isn't a tab). It is a
* button-styled GridLayout (Buttons can't hold images), so it borrows the
* .tab-button look and adds the elevation MaterialButtons get for free. */
.tab-mic-button {
width: 56;
/* The real MaterialButtons render 48dp tall inside a 60dp layout box (6dp
* insets top and bottom); the margins and explicit height reproduce that.
* The height also bounds the tile's measure, without which its star row
* would collapse to content and pin the icon to the top. */
height: 48;
margin: 6 2;
android-elevation: 2;
}
.tab-mic-icon {
height: 20;
tint-color: #333333;
}
.ns-dark .tab-mic-icon {
tint-color: #cccccc;
}
.ns-dark .tab-button {
background-color: #333333;
color: #cccccc;
}
.ns-dark .tab-button-selected {
background-color: #e2e2e2;
color: #222222;
}
/* Settings tab rows. */
.settings-row {
margin-bottom: 8;
}
.settings-row-label {
font-size: 14;
margin-right: 10;
}
.mode-button {
font-size: 13;
@@ -214,20 +264,12 @@ Button.-primary {
margin: 2;
font-size: 14;
}
.ring-row {
margin-top: 4;
}
.ring-label {
font-size: 12;
color: #666666;
margin: 0 6 0 4;
}
.ring-button {
width: 44;
height: 36;
margin: 1;
/* Ring tab: simulated R1 inputs. */
.ring-pad-button {
margin: 3;
padding: 0;
font-size: 13;
height: 52;
font-size: 14;
}
/*
* Pairing scan list (phone-ui/pairing-page). Rows are Repeater items: product
+11
View File
@@ -60,6 +60,15 @@ function applySettingsTextFieldContrast(textField: TextField): void {
nativeTextField.setSelectAllOnFocus(true)
}
/**
* Leaving keyboard-input mode: the glasses navigated away from the text
* setting, so the phone's keyboard has nothing to type into any more.
*/
function dismissTextEditorKeyboard(page: Page): void {
page.getViewById<TextField>('settingsTextField')?.dismissSoftInput()
page.getViewById<TextField>('secondarySettingsTextField')?.dismissSoftInput()
}
function focusTextEditor(page: Page): void {
setTimeout(() => {
const textField = page.getViewById<TextField>('settingsTextField')
@@ -109,6 +118,8 @@ export function loaded(args: EventData) {
if (propertyArgs.propertyName === 'activeTextSettingId') {
if (model.isTextSettingEditorActive) {
focusTextEditor(page)
} else {
dismissTextEditorKeyboard(page)
}
}
},
+15 -7
View File
@@ -29,10 +29,12 @@
visibility="{{ displayPreviewMessageVisibility }}">
<Label text="{{ displayPreviewMessage }}" textWrap="true" horizontalAlignment="center" verticalAlignment="center" />
</GridLayout>
<StackLayout row="1" class="p-20">
<rc:remote-controls />
<Button text="Stop recording" tap="{{ onStopRecordingTap }}" visibility="{{ stopRecordingButtonVisibility }}" />
</StackLayout>
<!-- The controls get the whole star row so the active tab's
content can center in the leftover height. -->
<GridLayout row="1" rows="*,auto" class="p-20">
<rc:remote-controls row="0" visibility="{{ controlsVisibility }}" />
<Button row="1" text="Stop recording" tap="{{ onStopRecordingTap }}" visibility="{{ stopRecordingButtonVisibility }}" />
</GridLayout>
</GridLayout>
<GridLayout class="p-20" visibility="{{ landscapeLayoutVisibility }}">
@@ -56,7 +58,7 @@
<Label text="{{ displayPreviewMessage }}" textWrap="true" horizontalAlignment="center" verticalAlignment="center" />
</GridLayout>
<StackLayout row="0" col="1" class="m-l-16">
<rc:remote-controls />
<rc:remote-controls visibility="{{ controlsVisibility }}" />
<Button text="Stop recording" tap="{{ onStopRecordingTap }}" visibility="{{ stopRecordingButtonVisibility }}" />
</StackLayout>
</GridLayout>
@@ -84,13 +86,19 @@
<Button text="Close" tap="{{ onWarningsModalCloseTap }}" />
</StackLayout>
</ScrollView>
<!-- Keyboard-input mode: anchored to the bottom of the (keyboard-
shrunk) page, so it sits in the space below the mirror and only
overlaps the mirror when the open keyboard leaves too little
room. The tabbed controls are collapsed while it is up. -->
<StackLayout
class="system-name-modal"
visibility="{{ textSettingEditorVisibility }}"
horizontalAlignment="stretch"
verticalAlignment="top">
verticalAlignment="bottom">
<Label text="{{ activeTextEditorTitle }}" class="h2" />
<Label text="{{ activeTextSettingTitle }}" />
<!-- Per-field labels only matter with two fields; a single-field
edit's field title is the same string as the editor title. -->
<Label text="{{ activeTextSettingTitle }}" visibility="{{ secondaryTextSettingVisibility }}" />
<TextField
id="settingsTextField"
text="{{ activeTextSettingValue }}"
+81 -14
View File
@@ -20,8 +20,6 @@ import {
displayModeSetting,
mirrorTouchSetting,
onAnySettingChanged,
showBrightnessControlSetting,
showScreenSizeSetting,
type BrightnessSetting,
type DisplayModeSetting,
} from "../ui/dashboard-settings";
@@ -34,6 +32,12 @@ const LENS_ASPECT_RATIO = G2_LENS_WIDTH / G2_LENS_HEIGHT;
type LayoutOrientation = "portrait" | "landscape";
type ControlsTab = "settings" | "watch" | "ring";
// Survives navigation round-trips (a fresh view model is built per visit) but
// not process restarts.
let lastControlsTab: ControlsTab = "watch";
export class MainViewModel extends Observable {
private _status = "Disconnected.";
private _displayPreview: ImageSource | null = null;
@@ -212,6 +216,22 @@ export class MainViewModel extends Observable {
return Math.min(Screen.mainScreen.widthDIPs - 32, 480);
}
/**
* The simulated watch face (and the Back/Menu row under it) is capped at a
* 1.5:1 face aspect; on narrow phones the available width governs instead.
*/
get watchFaceWidth(): number {
// Must match .touchpad height in app.css.
const faceHeight = 230;
const available =
this._layoutOrientation === "landscape"
? // The landscape side panel column (see main-page.xml) minus its
// m-l-16 margin and the controls' own 8+8 margins.
360 - 32
: Screen.mainScreen.widthDIPs - 56; // p-20 padding + controls margins
return Math.min(available, Math.round(faceHeight * 1.5));
}
get portraitLayoutVisibility(): "visible" | "collapse" {
return this._layoutOrientation === "portrait" ? "visible" : "collapse";
}
@@ -231,6 +251,7 @@ export class MainViewModel extends Observable {
this.notifyPropertyChange("landscapeDisplayPreviewWidth", this.landscapeDisplayPreviewWidth);
this.notifyPropertyChange("landscapeDisplayPreviewHeight", this.landscapeDisplayPreviewHeight);
this.notifyPropertyChange("warningsModalWidth", this.warningsModalWidth);
this.notifyPropertyChange("watchFaceWidth", this.watchFaceWidth);
}
get activeTextSettingId(): string | null {
@@ -243,6 +264,8 @@ export class MainViewModel extends Observable {
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.
this.notifyPropertyChange("controlsVisibility", this.controlsVisibility);
}
}
@@ -871,23 +894,70 @@ export class MainViewModel extends Observable {
return this.mirrorGesture(swipeKind(args.direction), args);
}
// ---- display mode and brightness, beside the mirror ----
// ---- the tabbed controls area below the mirror ----
//
// Both controls are hidden unless enabled in Settings > Phone display
// (the settings themselves stay reachable through the Settings app).
// 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.
get screenSizeControlVisibility(): "visible" | "collapse" {
return showScreenSizeSetting.get() ? "visible" : "collapse";
private _controlsTab: ControlsTab = lastControlsTab;
get controlsVisibility(): "visible" | "collapse" {
return this.isTextSettingEditorActive ? "collapse" : "visible";
}
get brightnessControlVisibility(): "visible" | "collapse" {
return showBrightnessControlSetting.get() ? "visible" : "collapse";
get settingsTabVisibility(): "visible" | "collapse" {
return this._controlsTab === "settings" ? "visible" : "collapse";
}
get displayControlsVisibility(): "visible" | "collapse" {
return showScreenSizeSetting.get() || showBrightnessControlSetting.get() ? "visible" : "collapse";
get watchTabVisibility(): "visible" | "collapse" {
return this._controlsTab === "watch" ? "visible" : "collapse";
}
get ringTabVisibility(): "visible" | "collapse" {
return this._controlsTab === "ring" ? "visible" : "collapse";
}
get settingsTabClass(): string {
return this._controlsTab === "settings" ? "tab-button tab-button-selected" : "tab-button";
}
get watchTabClass(): string {
return this._controlsTab === "watch" ? "tab-button tab-button-selected" : "tab-button";
}
get ringTabClass(): string {
return this._controlsTab === "ring" ? "tab-button tab-button-selected" : "tab-button";
}
onSettingsTabTap(): void {
this.setControlsTab("settings");
}
onWatchTabTap(): void {
this.setControlsTab("watch");
}
onRingTabTap(): void {
this.setControlsTab("ring");
}
private setControlsTab(tab: ControlsTab): void {
if (this._controlsTab === tab) return;
this._controlsTab = tab;
// Remembered across navigations (module-level) so the page comes back on
// the tab it left on; deliberately not persisted to disk.
lastControlsTab = tab;
this.notifyPropertyChange("settingsTabVisibility", this.settingsTabVisibility);
this.notifyPropertyChange("watchTabVisibility", this.watchTabVisibility);
this.notifyPropertyChange("ringTabVisibility", this.ringTabVisibility);
this.notifyPropertyChange("settingsTabClass", this.settingsTabClass);
this.notifyPropertyChange("watchTabClass", this.watchTabClass);
this.notifyPropertyChange("ringTabClass", this.ringTabClass);
}
// ---- display mode and brightness, on the Settings tab ----
get displayModeLabel(): string {
return displayModeLabel(displayModeSetting.get()) + " ▾";
}
@@ -950,9 +1020,6 @@ export class MainViewModel extends Observable {
this.notifyPropertyChange("brightnessSliderEnabled", this.brightnessSliderEnabled);
this.notifyPropertyChange("brightnessPercent", this.brightnessPercent);
this.notifyPropertyChange("displayModeLabel", this.displayModeLabel);
this.notifyPropertyChange("screenSizeControlVisibility", this.screenSizeControlVisibility);
this.notifyPropertyChange("brightnessControlVisibility", this.brightnessControlVisibility);
this.notifyPropertyChange("displayControlsVisibility", this.displayControlsVisibility);
}
private readLayoutOrientation(): LayoutOrientation {
+64 -39
View File
@@ -1,47 +1,72 @@
<!--
The phone's controller for the glasses: the same scheme as the watch pad
(tap = select, double-tap or two fingers = back, hold = menu, swipes
navigate), a d-pad for the same four directions, the display-mode picker
and brightness beside the mirror, and a compact ring simulator for the R1's
own scheme. Used by main-page.xml in both orientations; binds to the page's
MainViewModel.
The phone's controller for the glasses, as a three-tab area below the mirror:
Settings (screen size + brightness), 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 (simulated R1 inputs on the ring's
own scheme). The narrow mic button at the tab bar's right edge fires the
wakeword 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 (keyboard-input mode).
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.
-->
<StackLayout xmlns="http://schemas.nativescript.org/tns.xsd" class="remote-controls">
<!-- Hidden by default; enabled in Settings > Phone display. -->
<GridLayout columns="auto,*,auto" class="display-controls" visibility="{{ displayControlsVisibility }}">
<Button col="0" text="{{ displayModeLabel }}" tap="{{ onDisplayModeTap }}" class="mode-button" visibility="{{ screenSizeControlVisibility }}" />
<GridLayout col="1" columns="auto,*" verticalAlignment="center" class="brightness" visibility="{{ brightnessControlVisibility }}">
<GridLayout xmlns="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" class="controls-tab-bar">
<Button col="0" text="Settings" tap="{{ onSettingsTabTap }}" class="{{ settingsTabClass }}" />
<Button col="1" text="Watch" tap="{{ onWatchTabTap }}" class="{{ watchTabClass }}" />
<Button col="2" text="Ring" tap="{{ onRingTabTap }}" class="{{ ringTabClass }}" />
<!-- A Button can't hold an image, so this is a button-styled tile. 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="*" tap="{{ onSyntheticMicTap }}" class="tab-button tab-mic-button">
<Image src="res://ic_tab_mic" class="tab-mic-icon" verticalAlignment="center" horizontalAlignment="center" />
</GridLayout>
</GridLayout>
<!-- Settings tab -->
<StackLayout row="1" visibility="{{ settingsTabVisibility }}">
<GridLayout rows="auto" columns="auto,*" class="settings-row">
<Label col="0" text="Screen size" 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="0" 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>
<StackLayout col="2" orientation="horizontal" verticalAlignment="center" class="auto-toggle" visibility="{{ brightnessControlVisibility }}">
<Label text="Auto" verticalAlignment="center" />
<Switch checked="{{ brightnessAuto }}" checkedChange="{{ onBrightnessAutoChange }}" />
</StackLayout>
</GridLayout>
</StackLayout>
<GridLayout class="touchpad" tap="{{ onPadTap }}" doubleTap="{{ onPadDoubleTap }}" longPress="{{ onPadLongPress }}" swipe="{{ onPadSwipe }}" touch="{{ onPadTouch }}">
<Label text="{{ padFocusLine }}" class="pad-focus" horizontalAlignment="center" verticalAlignment="center" />
<Label text="● select ●● back ‒ menu" class="pad-legend" horizontalAlignment="center" verticalAlignment="bottom" />
<Button text="▲" tap="{{ onDpadUp }}" class="pad-dpad-button" horizontalAlignment="center" verticalAlignment="top" />
<Button text="▼" tap="{{ onDpadDown }}" class="pad-dpad-button pad-dpad-down" horizontalAlignment="center" verticalAlignment="bottom" />
<Button text="◀" tap="{{ onDpadLeft }}" class="pad-dpad-button" horizontalAlignment="left" verticalAlignment="center" />
<Button text="▶" tap="{{ onDpadRight }}" class="pad-dpad-button" horizontalAlignment="right" verticalAlignment="center" />
</GridLayout>
<!-- Watch tab: centered in the leftover height, capped at the 1.5:1 face
aspect (watchFaceWidth = min(available, 1.5 x face height). -->
<StackLayout row="1" visibility="{{ watchTabVisibility }}" width="{{ watchFaceWidth }}" horizontalAlignment="center" verticalAlignment="center">
<GridLayout class="touchpad" tap="{{ onPadTap }}" doubleTap="{{ onPadDoubleTap }}" longPress="{{ onPadLongPress }}" swipe="{{ onPadSwipe }}" touch="{{ onPadTouch }}">
<Label text="{{ padFocusLine }}" class="pad-focus" horizontalAlignment="center" verticalAlignment="center" />
<Label text="● select ●● back ‒ menu" class="pad-legend" horizontalAlignment="center" verticalAlignment="bottom" />
<Button text="▲" tap="{{ onDpadUp }}" class="pad-dpad-button" horizontalAlignment="center" verticalAlignment="top" />
<Button text="▼" tap="{{ onDpadDown }}" class="pad-dpad-button pad-dpad-down" horizontalAlignment="center" verticalAlignment="bottom" />
<Button text="◀" tap="{{ onDpadLeft }}" class="pad-dpad-button" horizontalAlignment="left" verticalAlignment="center" />
<Button text="▶" tap="{{ onDpadRight }}" class="pad-dpad-button" horizontalAlignment="right" verticalAlignment="center" />
</GridLayout>
<GridLayout rows="auto" columns="*,*" class="action-row">
<Button col="0" text="Back" tap="{{ onBackTap }}" class="action-button" />
<Button col="1" text="Menu" tap="{{ onMenuTap }}" class="action-button" />
</GridLayout>
</StackLayout>
<GridLayout columns="*,*,*" class="action-row">
<Button col="0" text="Back" tap="{{ onBackTap }}" class="action-button" />
<Button col="1" text="Menu" tap="{{ onMenuTap }}" class="action-button" />
<Button col="2" text="Hey Even" tap="{{ onSyntheticMicTap }}" class="action-button" />
<!-- Ring tab -->
<GridLayout row="1" rows="auto,auto" columns="*,*,*" visibility="{{ ringTabVisibility }}" class="ring-grid">
<Button row="0" col="0" text="▲ Up" tap="{{ onSyntheticUpTap }}" class="ring-pad-button" />
<Button row="0" col="1" text="▼ Down" tap="{{ onSyntheticDownTap }}" class="ring-pad-button" />
<Button row="0" col="2" text="● Click" tap="{{ onSyntheticRightTap }}" class="ring-pad-button" />
<Button row="1" col="0" text="●● Double" tap="{{ onSyntheticLeftTap }}" class="ring-pad-button" />
<Button row="1" col="1" text="‒ Hold" tap="{{ onSyntheticLongPressTap }}" class="ring-pad-button" />
</GridLayout>
<!-- The "Touch mirror" toggle lives in Settings > Phone display. -->
<GridLayout columns="auto,*,*,*,*,*" class="ring-row">
<Label col="0" text="Ring" class="ring-label" verticalAlignment="center" />
<Button col="1" text="▲" tap="{{ onSyntheticUpTap }}" class="ring-button" />
<Button col="2" text="▼" tap="{{ onSyntheticDownTap }}" class="ring-button" />
<Button col="3" text="●" tap="{{ onSyntheticRightTap }}" class="ring-button" />
<Button col="4" text="●●" tap="{{ onSyntheticLeftTap }}" class="ring-button" />
<Button col="5" text="‒" tap="{{ onSyntheticLongPressTap }}" class="ring-button" />
</GridLayout>
</StackLayout>
</GridLayout>
-16
View File
@@ -308,22 +308,6 @@ export const mirrorTouchSetting = new ConfigSettingBoolean({
"Let touches on the phone's mirror act on the glasses UI: tap selects what it lands on, double-tap goes back, a hold opens the menu, swipes navigate.",
});
export const showBrightnessControlSetting = new ConfigSettingBoolean({
id: "show-brightness-control",
label: "Show brightness control",
storageKey: "phone.showBrightnessControl",
defaultValue: false,
description: "Show the brightness slider above the mirror on the phone's main screen.",
});
export const showScreenSizeSetting = new ConfigSettingBoolean({
id: "show-screen-size",
label: "Show screen size",
storageKey: "phone.showScreenSize",
defaultValue: false,
description: "Show the screen-size (display mode) picker above the mirror on the phone's main screen.",
});
// Wear OS watch remote (app/g2/wear-remote.ts, wear/). All three are read on
// every watch message, so a change applies immediately.
export const watchRemoteEnabledSetting = new ConfigSettingBoolean({
-4
View File
@@ -48,8 +48,6 @@ import {
firmwareDebugFlagsSetting,
lockScreenEnabledSetting,
saveVoiceRecordingsSetting,
showBrightnessControlSetting,
showScreenSizeSetting,
suspendEvenHubWhenScreenOffSetting,
terminalAutoReconnectSetting,
terminalLaunchPresetsSetting,
@@ -161,8 +159,6 @@ function settingsSections(): SettingsSection[] {
items: [
enumSettingMenuItem(previewColorSetting),
toggleSettingMenuItem(mirrorTouchSetting),
toggleSettingMenuItem(showBrightnessControlSetting),
toggleSettingMenuItem(showScreenSizeSetting),
],
},
{