Add screen-recording option

This commit is contained in:
James Babcock committed 2026-07-28 10:16:44 -07:00
1 parent 4c946631e0
commit b738ce4bb2
12 files changed
+644 -99

No files matched your search

+4 -2
View File
@@ -2,6 +2,8 @@
<ActionBar title="Faceclaw">
<ActionItem text="{{ buttonLabel }}" tap="{{ onTap }}" isEnabled="{{ canRun }}" android.position="popup" />
<ActionItem text="Configure devices" tap="{{ onConfigureTap }}" isEnabled="{{ canRun }}" android.position="popup" />
<ActionItem text="Take screenshot" tap="{{ onTakeScreenshotTap }}" android.position="popup" />
<ActionItem text="Record screen" tap="{{ onRecordScreenTap }}" android.position="popup" />
<ActionItem text="Uninstall custom firmware" tap="{{ onUninstallFirmwareTap }}" isEnabled="{{ canRun }}" android.position="popup" />
<ActionItem text="{{ showLogMenuLabel }}" tap="{{ onToggleLogTap }}" android.position="popup" />
</ActionBar>
@@ -42,7 +44,7 @@
<Button row="0" col="2" text="Microphone" tap="{{ onSyntheticMicTap }}" />
<Button row="2" col="1" text="Swipe down" tap="{{ onSyntheticDownTap }}" />
</GridLayout>
<Button text="Save raw screenshot" tap="{{ onScreenshotTap }}" visibility="{{ screenshotButtonVisibility }}" />
<Button text="Stop recording" tap="{{ onStopRecordingTap }}" visibility="{{ stopRecordingButtonVisibility }}" />
</StackLayout>
<Label row="2" text="{{ status }}" class="m-t-16" textWrap="true" />
<ScrollView id="logScrollView" row="3" class="m-t-16" visibility="{{ showLogVisibility }}">
@@ -90,7 +92,7 @@
<Button row="0" col="2" text="Microphone" tap="{{ onSyntheticMicTap }}" />
<Button row="2" col="1" text="Swipe down" tap="{{ onSyntheticDownTap }}" />
</GridLayout>
<Button text="Save raw screenshot" tap="{{ onScreenshotTap }}" visibility="{{ screenshotButtonVisibility }}" />
<Button text="Stop recording" tap="{{ onStopRecordingTap }}" visibility="{{ stopRecordingButtonVisibility }}" />
</StackLayout>
<Label row="1" col="0" colSpan="2" text="{{ status }}" class="m-t-16" textWrap="true" />
<ScrollView id="logScrollViewLandscape" row="2" col="0" colSpan="2" class="m-t-16" visibility="{{ showLogVisibility }}">
+30 -14
View File
@@ -17,7 +17,7 @@ export class MainViewModel extends Observable {
private _evenAppConflictWarningVisible = false;
private _firmwareWarningMessage = "";
private _firmwareWarningVisible = false;
private _rawScreenshotsEnabled = false;
private _screenRecordingActive = false;
private _batteryOptimizationWarningVisible = false;
private _showLog = false;
private _phase: "disconnected" | "connecting" | "connected" | "charging" | "disconnecting" = "disconnected";
@@ -37,7 +37,7 @@ export class MainViewModel extends Observable {
this.evenAppConflictWarningVisible = snapshot.evenAppConflictWarningVisible;
this.firmwareWarningMessage = snapshot.firmwareWarningMessage;
this.firmwareWarningVisible = snapshot.firmwareWarningVisible;
this.rawScreenshotsEnabled = snapshot.rawScreenshotsEnabled;
this.screenRecordingActive = snapshot.screenRecordingActive;
this.batteryOptimizationWarningVisible = snapshot.batteryOptimizationWarningVisible;
});
}
@@ -258,27 +258,43 @@ export class MainViewModel extends Observable {
return this._firmwareWarningVisible ? "visible" : "collapse";
}
get rawScreenshotsEnabled(): boolean {
return this._rawScreenshotsEnabled;
get screenRecordingActive(): boolean {
return this._screenRecordingActive;
}
set rawScreenshotsEnabled(value: boolean) {
if (this._rawScreenshotsEnabled !== value) {
this._rawScreenshotsEnabled = value;
this.notifyPropertyChange("rawScreenshotsEnabled", value);
this.notifyPropertyChange("screenshotButtonVisibility", this.screenshotButtonVisibility);
set screenRecordingActive(value: boolean) {
if (this._screenRecordingActive !== value) {
this._screenRecordingActive = value;
this.notifyPropertyChange("screenRecordingActive", value);
this.notifyPropertyChange("stopRecordingButtonVisibility", this.stopRecordingButtonVisibility);
}
}
get screenshotButtonVisibility(): "visible" | "collapse" {
return this._rawScreenshotsEnabled ? "visible" : "collapse";
get stopRecordingButtonVisibility(): "visible" | "collapse" {
return this._screenRecordingActive ? "visible" : "collapse";
}
onScreenshotTap(): void {
onTakeScreenshotTap(): void {
try {
dashboardController.saveRawDashboardScreenshot();
dashboardController.saveScreenshot();
} catch (error) {
console.error("raw screenshot failed", error);
console.error("screenshot failed", error);
}
}
onRecordScreenTap(): void {
try {
dashboardController.startScreenRecording();
} catch (error) {
console.error("screen recording start failed", error);
}
}
onStopRecordingTap(): void {
try {
dashboardController.stopScreenRecording();
} catch (error) {
console.error("screen recording stop failed", error);
}
}