forked from Blendman974/faceclaw
Phone screen input shows gesture help for wake (and not random other gesture-help)
This commit is contained in:
1 parent
22c31f4240
commit
f01214f4a0
8 files changed
+73
-12
No files matched your search
@@ -23,12 +23,25 @@ export function glassesDisplayLabel(state: GlassesDisplayState): string {
|
||||
if (state.silentMode) {
|
||||
return "Silent mode";
|
||||
}
|
||||
if (!state.screenOn) {
|
||||
if (glassesDisplayAsleep(state)) {
|
||||
return "Display off";
|
||||
}
|
||||
return state.foregroundTitle || "Launcher";
|
||||
}
|
||||
|
||||
/**
|
||||
* True when the label reads "Display off": the screen is dark but the glasses
|
||||
* (or the preview standing in for them) would light it on a wake gesture.
|
||||
*/
|
||||
export function glassesDisplayAsleep(state: GlassesDisplayState): boolean {
|
||||
return (
|
||||
state.phase !== "charging" &&
|
||||
(state.phase === "connected" || state.previewMode) &&
|
||||
!state.silentMode &&
|
||||
!state.screenOn
|
||||
);
|
||||
}
|
||||
|
||||
export function chargingDisplayLabel(battery: number | null): string {
|
||||
return validBatteryLevel(battery) ? `Charging · G2 ${battery}%` : "Charging";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user