Files
faceclaw/app/phone-ui/remote-controls.xml
T

77 lines
5.3 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--
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 (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).
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.
-->
<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>
<!-- 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>
<!-- 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>