Add a proper app icon, remove g2-kit dependency, add ACKNOWLEDGEMENTS file
No files matched your search
@@ -0,0 +1,4 @@
|
||||
Many thanks to g2-kit-unofficial: https://github.com/Commute773/g2-kit-unofficial/
|
||||
and others who contributed to documenting the G2's bluetooth protocol. It has enabled me
|
||||
to keep my room clean, so to speak.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 106 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
<color name="ic_launcher_background">#00000000</color>
|
||||
</resources>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EventSourceType, EventSourceTypeName, OsEventTypeList, OsEventTypeName, } from "g2-kit/lite";
|
||||
import { ImageSource } from "@nativescript/core";
|
||||
import { EventSourceType, EventSourceTypeName, OsEventTypeList, OsEventTypeName } from "./events";
|
||||
import { loadDeviceAddresses } from "./device-addresses";
|
||||
import { ensureBlePermissions } from "./android-permissions";
|
||||
import { FaceclawCommunicatorBridge, type FrameMetrics, type RawInputEvent } from "../native/faceclaw-communicator";
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
getDashboardNightscoutSettings,
|
||||
getDashboardSystemCardName,
|
||||
receiveInput,
|
||||
resetDashboardSleepTimerAndWake,
|
||||
setDashboardBatteryLevels,
|
||||
setDashboardActions,
|
||||
setDashboardNightscoutApiToken,
|
||||
@@ -238,6 +239,7 @@ class DashboardController {
|
||||
this.log = "";
|
||||
this.lastInput = "waiting...";
|
||||
this.lastSys = "none yet";
|
||||
resetDashboardSleepTimerAndWake();
|
||||
this.refreshEvenAppStatus();
|
||||
this.setPhase("connecting");
|
||||
this.setStatus("Connecting to the glasses...");
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
export const EventSourceType = {
|
||||
TOUCH_EVENT_FORM_DUMMY_NULL: 0,
|
||||
TOUCH_EVENT_FROM_GLASSES_R: 1,
|
||||
TOUCH_EVENT_FROM_RING: 2,
|
||||
TOUCH_EVENT_FROM_GLASSES_L: 3,
|
||||
} as const;
|
||||
|
||||
export const EventSourceTypeName: Record<number, string> = {
|
||||
0: "TOUCH_EVENT_FORM_DUMMY_NULL",
|
||||
1: "TOUCH_EVENT_FROM_GLASSES_R",
|
||||
2: "TOUCH_EVENT_FROM_RING",
|
||||
3: "TOUCH_EVENT_FROM_GLASSES_L",
|
||||
};
|
||||
|
||||
export const OsEventTypeList = {
|
||||
CLICK_EVENT: 0,
|
||||
SCROLL_TOP_EVENT: 1,
|
||||
SCROLL_BOTTOM_EVENT: 2,
|
||||
DOUBLE_CLICK_EVENT: 3,
|
||||
FOREGROUND_ENTER_EVENT: 4,
|
||||
FOREGROUND_EXIT_EVENT: 5,
|
||||
ABNORMAL_EXIT_EVENT: 6,
|
||||
SYSTEM_EXIT_EVENT: 7,
|
||||
IMU_DATA_REPORT: 8,
|
||||
} as const;
|
||||
|
||||
export const OsEventTypeName: Record<number, string> = {
|
||||
0: "CLICK_EVENT",
|
||||
1: "SCROLL_TOP_EVENT",
|
||||
2: "SCROLL_BOTTOM_EVENT",
|
||||
3: "DOUBLE_CLICK_EVENT",
|
||||
4: "FOREGROUND_ENTER_EVENT",
|
||||
5: "FOREGROUND_EXIT_EVENT",
|
||||
6: "ABNORMAL_EXIT_EVENT",
|
||||
7: "SYSTEM_EXIT_EVENT",
|
||||
8: "IMU_DATA_REPORT",
|
||||
};
|
||||
@@ -8,7 +8,7 @@ import { nightscoutBridge } from "../native/nightscout";
|
||||
import { readActiveNotificationIcons } from "../native/notification-icons";
|
||||
import { readPhoneBatteryState } from "../native/phone-battery";
|
||||
import { readSystemStatusIcons } from "../native/system-status-icons";
|
||||
import { OsEventTypeList, EventSourceType } from "g2-kit/lite";
|
||||
import { EventSourceType, OsEventTypeList } from "../g2/events";
|
||||
import {
|
||||
getDashboardPlugin,
|
||||
isBlankDashboardPlugin,
|
||||
@@ -219,6 +219,17 @@ export function applyDashboardScreenTimeout(nowMs = Date.now()): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function resetDashboardSleepTimerAndWake(nowMs = Date.now()): boolean {
|
||||
dashboardState.lastInputAtMs = nowMs;
|
||||
if (dashboardState.screenOn) return false;
|
||||
|
||||
dashboardState.screenOn = true;
|
||||
dashboardState.tiledWakePaintPending = dashboardState.wakeMode === "tiled";
|
||||
dashboardLayers.clearToBase();
|
||||
dashboardLayers.push(createRootMenuLayer());
|
||||
return true;
|
||||
}
|
||||
|
||||
export function setDashboardBatteryLevels(levels: Partial<DashboardBatteryLevels>): void {
|
||||
dashboardState.battery = {
|
||||
...dashboardState.battery,
|
||||
@@ -411,12 +422,12 @@ function createRootMenuLayer(): MenuLayer {
|
||||
return new RootMenuLayer(
|
||||
"Menu",
|
||||
[
|
||||
{
|
||||
/*{
|
||||
label: "Apps",
|
||||
onSelect: (ctx) => {
|
||||
ctx.stack.push(createAppsMenuLayer());
|
||||
},
|
||||
},
|
||||
},*/
|
||||
{
|
||||
label: "Settings",
|
||||
onSelect: (ctx) => {
|
||||
@@ -720,7 +731,6 @@ class AboutLayer implements Layer {
|
||||
paint(): GrayImage {
|
||||
const image = new GrayImage(G2_LENS_WIDTH, G2_LENS_HEIGHT, 0);
|
||||
const logo = getDashboardLogo();
|
||||
image.drawRect(12, 12, G2_LENS_WIDTH - 24, G2_LENS_HEIGHT - 24, 52);
|
||||
image.drawText(dashboardFont, 22, 16, "About Faceclaw", 220);
|
||||
if (logo) {
|
||||
image.bitBlt(logo, 22, 42);
|
||||
@@ -729,17 +739,13 @@ class AboutLayer implements Layer {
|
||||
image.drawText(dashboardFont, 108, 64, "Dashboard prototype", 180);
|
||||
|
||||
const aboutLines = [
|
||||
"A lobster on top of a smiley face.",
|
||||
"Perching on the faces of giants.",
|
||||
"",
|
||||
"The menu opens dashboard cards.",
|
||||
"Settings configure card slots.",
|
||||
"Double-click backs out of menus.",
|
||||
"By James Babcock. Distributed under the GNU General Public License, version 3.",
|
||||
"Version 0.1.0. Too much of an early janky development prototype to have",
|
||||
"proper numbered releases."
|
||||
];
|
||||
for (let index = 0; index < aboutLines.length; index++) {
|
||||
image.drawText(dashboardFont, 22, 128 + index * 14, aboutLines[index]!, 180);
|
||||
}
|
||||
image.drawText(dashboardFont, 22, 252, "Double-click to go back", 110);
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 1.7 MiB |
@@ -10,7 +10,6 @@
|
||||
"dependencies": {
|
||||
"@nativescript/core": "~9.0.0",
|
||||
"@nativescript/theme": "^3.1.0",
|
||||
"g2-kit": "file:../g2-kit-unofficial",
|
||||
"lodash": "^4.18.1",
|
||||
"upng-js": "^2.1.0"
|
||||
},
|
||||
@@ -21,21 +20,6 @@
|
||||
"typescript": "~5.4.0"
|
||||
}
|
||||
},
|
||||
"../g2-kit-unofficial": {
|
||||
"name": "g2-kit",
|
||||
"version": "0.1.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@bufbuild/protobuf": "^2.11.0",
|
||||
"@stoprocent/noble": "^2.4.0",
|
||||
"ws": "^8.20.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest",
|
||||
"@types/ws": "^8.18.1",
|
||||
"typescript": "^6.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",
|
||||
@@ -2517,10 +2501,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/g2-kit": {
|
||||
"resolved": "../g2-kit-unofficial",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/gensync": {
|
||||
"version": "1.0.0-beta.2",
|
||||
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"dependencies": {
|
||||
"@nativescript/core": "~9.0.0",
|
||||
"@nativescript/theme": "^3.1.0",
|
||||
"g2-kit": "file:../g2-kit-unofficial",
|
||||
"lodash": "^4.18.1",
|
||||
"upng-js": "^2.1.0"
|
||||
},
|
||||
|
||||