From 01527adda9b1e31aacf5c66cb09735bcbe8a23fc Mon Sep 17 00:00:00 2001 From: James Babcock Date: Sun, 30 Aug 2026 19:50:37 -0700 Subject: [PATCH] Simulated Ring input is touchpad-style --- app/app.css | 10 ++++------ app/phone-ui/main-view-model.ts | 22 +++++++++++++++------- app/phone-ui/remote-controls.xml | 22 +++++++++++++--------- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/app/app.css b/app/app.css index 805076e9..8296f537 100644 --- a/app/app.css +++ b/app/app.css @@ -264,12 +264,10 @@ Button.-primary { margin: 2; font-size: 14; } -/* Ring tab: simulated R1 inputs. */ -.ring-pad-button { - margin: 3; - padding: 0; - height: 52; - font-size: 14; +/* Ring tab: the same touchpad, but portrait like the ring's own pad. */ +.ring-touchpad { + width: 150; + height: 250; } /* * Pairing scan list (phone-ui/pairing-page). Rows are Repeater items: product diff --git a/app/phone-ui/main-view-model.ts b/app/phone-ui/main-view-model.ts index ea4e4835..3cb45ac5 100644 --- a/app/phone-ui/main-view-model.ts +++ b/app/phone-ui/main-view-model.ts @@ -12,7 +12,6 @@ import { type View, } from "@nativescript/core"; import { dashboardController, type MirrorTouchKind } from "../g2/dashboard-controller"; -import { shell } from "../ui/shell/shell"; import { brightnessSetting, DISPLAY_MODE_VALUES, @@ -815,18 +814,27 @@ export class MainViewModel extends Observable { await dashboardController.injectSyntheticRingInput("scroll-down"); } - async onSyntheticLeftTap(): Promise { - await dashboardController.injectSyntheticRingInput("double-click"); - } - - async onSyntheticRightTap(): Promise { + async onRingPadTap(): Promise { await dashboardController.injectSyntheticRingInput("click"); } - async onSyntheticLongPressTap(): Promise { + async onRingPadDoubleTap(): Promise { + await dashboardController.injectSyntheticRingInput("double-click"); + } + + async onRingPadLongPress(): Promise { await dashboardController.injectSyntheticRingInput("long-press"); } + /** The ring pad only has a vertical axis, so left/right swipes are ignored. */ + async onRingPadSwipe(args: SwipeGestureEventData): Promise { + if (args.direction === SwipeDirection.up) { + await dashboardController.injectSyntheticRingInput("scroll-up"); + } else if (args.direction === SwipeDirection.down) { + await dashboardController.injectSyntheticRingInput("scroll-down"); + } + } + async onSyntheticMicTap(): Promise { await dashboardController.injectSyntheticRingInput("wakeword"); } diff --git a/app/phone-ui/remote-controls.xml b/app/phone-ui/remote-controls.xml index 99036282..0213682e 100644 --- a/app/phone-ui/remote-controls.xml +++ b/app/phone-ui/remote-controls.xml @@ -2,8 +2,9 @@ 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 + 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). 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). @@ -61,12 +62,15 @@ - - -