forked from Blendman974/faceclaw
Add Wear OS companion app and remote controls
Add a Wearable Data Layer bridge for syncing dashboard state and commands. Introduce a standalone watch app with assistant, app launcher, touchpad remote, settings, and connectivity UI.
This commit is contained in:
85 files changed
+5813
-102
No files matched your search
@@ -4,6 +4,7 @@
|
||||
* makes the content area exactly the 576x288 surface EvenHub apps expect.
|
||||
*/
|
||||
import { GrayImage } from "../../graphics/image";
|
||||
import { EVENHUB_SCREEN_WIDTH } from "./compositor";
|
||||
import { type DashboardInputEvent, type Layer, type LayerContext } from "../../ui/layers";
|
||||
import {
|
||||
createInProcessWindow,
|
||||
@@ -20,6 +21,15 @@ class EvenHubAppLayer implements Layer {
|
||||
|
||||
paint(ctx: LayerContext): GrayImage {
|
||||
const size = ctx.stack.getBaseSize();
|
||||
// EvenHub apps lay out for the stock 576-wide surface. In the full-panel
|
||||
// display mode the window is 640 wide; paint at stock width and centre
|
||||
// it rather than leaving all the slack on the right.
|
||||
if (size.width > EVENHUB_SCREEN_WIDTH) {
|
||||
const content = this.session.paint({ width: EVENHUB_SCREEN_WIDTH, height: size.height }, ctx.stack.isFocused());
|
||||
const image = new GrayImage(size.width, size.height, 0);
|
||||
content.composeInto(image, Math.floor((size.width - EVENHUB_SCREEN_WIDTH) / 2), 0);
|
||||
return image;
|
||||
}
|
||||
return this.session.paint(size, ctx.stack.isFocused());
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
import { ApplicationSettings } from "@nativescript/core";
|
||||
import { GrayImage } from "../../graphics/image";
|
||||
import { EvenHubFont } from "../../graphics/evenhub-font";
|
||||
import { type DashboardInputEvent, type Layer } from "../../ui/layers";
|
||||
import { type DashboardInputEvent, type InputSource, type Layer } from "../../ui/layers";
|
||||
import {
|
||||
anthropicApiKeySetting,
|
||||
elevenLabsApiKeySetting,
|
||||
@@ -1346,12 +1346,17 @@ function luminance(r: number, g: number, b: number): number {
|
||||
return Math.round(0.2126 * r + 0.7152 * g + 0.0722 * b);
|
||||
}
|
||||
|
||||
/** ring/left-arm/right-arm -> PB EventSourceType. */
|
||||
function gestureSource(source: "ring" | "left-arm" | "right-arm"): number {
|
||||
/**
|
||||
* ring/left-arm/right-arm -> PB EventSourceType. The watch is reported to
|
||||
* EvenHub apps as the ring: they only know stock hardware, and the watch's
|
||||
* ring-vocabulary gestures mean the same thing.
|
||||
*/
|
||||
function gestureSource(source: InputSource): number {
|
||||
switch (source) {
|
||||
case "right-arm":
|
||||
return 1;
|
||||
case "ring":
|
||||
case "watch":
|
||||
return 2;
|
||||
case "left-arm":
|
||||
return 3;
|
||||
|
||||
Reference in new issue
Block a user