Simulated Ring input is touchpad-style

This commit is contained in:
James Babcock committed 2026-08-30 19:50:37 -07:00
1 parent 602f66f15b
commit 01527adda9
3 files changed
+32 -22

No files matched your search

+4 -6
View File
@@ -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
+15 -7
View File
@@ -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<void> {
await dashboardController.injectSyntheticRingInput("double-click");
}
async onSyntheticRightTap(): Promise<void> {
async onRingPadTap(): Promise<void> {
await dashboardController.injectSyntheticRingInput("click");
}
async onSyntheticLongPressTap(): Promise<void> {
async onRingPadDoubleTap(): Promise<void> {
await dashboardController.injectSyntheticRingInput("double-click");
}
async onRingPadLongPress(): Promise<void> {
await dashboardController.injectSyntheticRingInput("long-press");
}
/** The ring pad only has a vertical axis, so left/right swipes are ignored. */
async onRingPadSwipe(args: SwipeGestureEventData): Promise<void> {
if (args.direction === SwipeDirection.up) {
await dashboardController.injectSyntheticRingInput("scroll-up");
} else if (args.direction === SwipeDirection.down) {
await dashboardController.injectSyntheticRingInput("scroll-down");
}
}
async onSyntheticMicTap(): Promise<void> {
await dashboardController.injectSyntheticRingInput("wakeword");
}
+13 -9
View File
@@ -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 @@
</GridLayout>
</StackLayout>
<!-- 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" />
<!-- 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, so the legend sits in the middle where the
watch pad keeps its focus line. -->
<GridLayout row="1" visibility="{{ ringTabVisibility }}" class="touchpad ring-touchpad"
horizontalAlignment="center" verticalAlignment="center"
tap="{{ onRingPadTap }}" doubleTap="{{ onRingPadDoubleTap }}"
longPress="{{ onRingPadLongPress }}" swipe="{{ onRingPadSwipe }}">
<Button text="▲" tap="{{ onSyntheticUpTap }}" class="pad-dpad-button" horizontalAlignment="center" verticalAlignment="top" />
<Button text="▼" tap="{{ onSyntheticDownTap }}" class="pad-dpad-button" horizontalAlignment="center" verticalAlignment="bottom" />
</GridLayout>
</GridLayout>