forked from Blendman974/faceclaw
<details> <summary>Prompts Used</summary> Thanks. Next up, let's add a "Phone display" section to the Settings app (above the Watch section). We'll add a "Preview color" setting (options: White, Green; default White), which controls whether the mirror display is white/grayscale (best looking) or green (matches the physical glasses). We'll move the "Touch mirror" toggle setting (currently on the phone main screen) into the phone display settings menu. We'll add a "Show brightness control" toggle setting (default off) and a "Show screen size" toggle setting (default off), which control the visibility of the corresponding elements on the phone main screen. Let's also make it so that double-tapping the watch (or simulated watch on the phone, mirror, etc) while the app-switcher is selected turns off the glasses display, in the same way that double-tappign the R1 ring does. > All four pieces are in and everything builds (webpack, Gradle with the Java changes, and a clean `tsc`). Summary: > > **"Phone display" Settings section** — added between Roam and Watch in the on-glasses Settings app, with four entries: > - **Preview color** (White/Green, default White) — new enum setting `phone.previewColor`. The colorization happens in the Java preview path: `PreviewBitmapUtil.fromGray` gained a `green` variant whose LUT maps luminance to green-on-black instead of grayscale, threaded through `getCompositePreviewBitmap` → `getCompositePreview(green)` → the controller, which reads the setting per refresh. A settings change also schedules an immediate preview refresh, so flipping the color updates the mirror right away instead of waiting for the next composited frame. > - **Touch mirror** — moved from the phone main screen. It's now a proper `ConfigSettingBoolean` reusing the existing `phone.mirrorTouch` storage key, so anyone who already turned it off keeps that choice. The label+switch pair is gone from the ring row in `remote-controls.xml`, and the view model reads the setting per gesture. > - **Show brightness control** and **Show screen size** (both default off) — new booleans controlling visibility of the brightness slider/Auto toggle and the display-mode picker on the phone main screen. The whole display-controls row collapses when both are off; the bindings refresh through the existing `onAnySettingChanged` → `refreshDisplayControls` path, so toggling them from the glasses updates the phone screen live. Note this means the main screen is more minimal out of the box — brightness and screen size remain reachable via the Settings app either way. > > **Watch double-tap at the app switcher** — the watch-scheme special case in `handleSidebarInput` is removed: a double-click from any source (watch, phone pad/d-pad, mirror double-tap — they all arrive as source `"watch"`) now turns the display off when the sidebar is selected, exactly like the ring's. The original code deliberately excluded the watch on the theory that sleeping was a trap since any watch gesture re-wakes; with your "Watch input wakes display" setting now gated (and double-tap waking a dark display regardless), the toggle behavior is symmetric: double-tap at the switcher sleeps, double-tap again wakes. > > Hardware-test notes: the green preview tint and the collapsed-controls layout are worth one visual check on the phone, and the double-tap-to-sleep from the watch is a quick on-device confirm. </details>
48 lines
3.4 KiB
XML
48 lines
3.4 KiB
XML
<!--
|
||
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.
|
||
-->
|
||
<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 }}">
|
||
<Label col="0" text="☀" class="brightness-icon" verticalAlignment="center" />
|
||
<Slider col="1" width="100%" minValue="0" maxValue="100" value="{{ brightnessPercent }}" valueChange="{{ onBrightnessChange }}" isEnabled="{{ brightnessSliderEnabled }}" />
|
||
</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>
|
||
|
||
<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 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" />
|
||
</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>
|