diff --git a/App_Resources/Android/src/main/res/drawable/ic_input_history.xml b/App_Resources/Android/src/main/res/drawable/ic_input_history.xml new file mode 100644 index 00000000..fac2b0c3 --- /dev/null +++ b/App_Resources/Android/src/main/res/drawable/ic_input_history.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/App_Resources/Android/src/main/res/drawable/ic_show_glasses.xml b/App_Resources/Android/src/main/res/drawable/ic_show_glasses.xml new file mode 100644 index 00000000..885a3245 --- /dev/null +++ b/App_Resources/Android/src/main/res/drawable/ic_show_glasses.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/App_Resources/Android/src/main/res/drawable/ic_show_phone.xml b/App_Resources/Android/src/main/res/drawable/ic_show_phone.xml new file mode 100644 index 00000000..c4c24609 --- /dev/null +++ b/App_Resources/Android/src/main/res/drawable/ic_show_phone.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/Contents.json b/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/Contents.json new file mode 100644 index 00000000..78660545 --- /dev/null +++ b/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "ic_input_history@3x.png", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/ic_input_history@3x.png b/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/ic_input_history@3x.png new file mode 100644 index 00000000..3fdd7b0a Binary files /dev/null and b/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/ic_input_history@3x.png differ diff --git a/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/Contents.json b/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/Contents.json new file mode 100644 index 00000000..a85e2333 --- /dev/null +++ b/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "ic_show_glasses@3x.png", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/ic_show_glasses@3x.png b/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/ic_show_glasses@3x.png new file mode 100644 index 00000000..ebf50663 Binary files /dev/null and b/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/ic_show_glasses@3x.png differ diff --git a/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/Contents.json b/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/Contents.json new file mode 100644 index 00000000..575cf544 --- /dev/null +++ b/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "ic_show_phone@3x.png", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/ic_show_phone@3x.png b/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/ic_show_phone@3x.png new file mode 100644 index 00000000..96e58794 Binary files /dev/null and b/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/ic_show_phone@3x.png differ diff --git a/CHANGELOG b/CHANGELOG index 2a6d8960..0861fede 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,7 @@ * Fix a bug on iOS that would cause corrupted installs of EvenHub apps * EvenHub apps can use the glasses microphone on iOS (such as Chess's voice moves, which said "Mic unavailable") * EvenHub apps on iOS should now be able to use the mic +* Fix a bug that caused fade-in on wake to be shown at the wrong depth on iOS ## 0.8.4 - 2026-10-17 diff --git a/app/app.css b/app/app.css index 9c8460c5..4dbacd37 100644 --- a/app/app.css +++ b/app/app.css @@ -154,6 +154,60 @@ Button.-primary { color: #222222; } +/* Keyboard-input panel: tighter than the setting editor, with the text + * box's edges in line with the title and the one-strip buttons (the theme's + * 16dp TextView side margins doubled the inset). */ +.system-name-modal.keyboard-input-panel { + margin: 8; + padding: 8 16 12 16; +} + +.keyboard-input-panel TextView { + margin: 4 0 0 0; + padding: 6; +} + +/* Glasses-only: the field stays focused for the IME but is an invisible + * sliver; the hint line takes its place. */ +.keyboard-input-panel TextView.keyboard-input-field-hidden { + opacity: 0; + height: 1; + min-height: 0; + margin: 0; + padding: 0; +} + +.system-name-modal Label.keyboard-input-hidden-hint, +.ns-dark .system-name-modal Label.keyboard-input-hidden-hint { + color: #666666; + padding: 8 0; +} + +.keyboard-input-buttons { + margin-top: 8; +} + +.keyboard-input-panel Button, +.keyboard-input-panel Button.-primary { + margin: 0; + font-size: 16; +} + +.keyboard-input-panel Button.keyboard-input-gap { + margin-left: 8; +} + +/* Flat icon buttons in the panel's title row (the modal stays light in dark + * mode, so one tint). */ +.panel-icon-button { + padding: 6 8; +} + +.panel-icon { + height: 20; + tint-color: #333333; +} + /* Modal behind the action bar's warning triangle: the problem-status warnings * that used to sit inline on the main page, each with its fix-it button. * The width is set from the view model (near-full-width on phones, capped on diff --git a/app/app.ios.css b/app/app.ios.css index fbed4e8e..3a4f1ec5 100644 --- a/app/app.ios.css +++ b/app/app.ios.css @@ -67,3 +67,15 @@ Page.main-page { .main-landscape .system-name-modal { padding: 6 12; } .main-landscape .system-name-modal .h2 { visibility: collapse; } .main-landscape .system-name-modal Button { padding: 6 8; margin-top: 0; margin-bottom: 0; } + +/* Keyboard-input panel: the one-strip buttons and title-row icons (see app.css). */ +.main-page .system-name-modal.keyboard-input-panel { padding: 8 16 12 16; } +.main-landscape .system-name-modal.keyboard-input-panel { padding: 6 12; } +.main-page .keyboard-input-panel TextView { margin: 4 0 0 0; padding: 6; } +.main-page .keyboard-input-panel TextView.keyboard-input-field-hidden { opacity: 0; height: 1; min-height: 0; margin: 0; padding: 0; } +.main-page .keyboard-input-hidden-hint { color: #666666; padding: 8 0; } +.main-page .keyboard-input-buttons { margin-top: 8; } +.main-page .keyboard-input-panel Button { margin: 0; } +.main-page .keyboard-input-panel Button.keyboard-input-gap { margin-left: 8; } +.main-page .panel-icon-button { padding: 6 8; } +.main-page .panel-icon { height: 20; tint-color: #333333; } diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index a04781f6..0b995653 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -124,12 +124,10 @@ export type DashboardSnapshot = { activeTextEditorToggleValue: boolean; activeTextEditorToggleVisible: boolean; /** - * The keyboard dialog is up on the glasses (opened by the phone's keyboard - * button): the phone shows its typing panel, with a send button per - * destination in the glasses menu's row order. + * The keyboard dialog is open (opened by the phone's keyboard button): the + * phone shows its typing panel, driven by keyboardInputSession. */ keyboardInputActive: boolean; - keyboardInputTargets: ReadonlyArray<{ id: string; label: string }>; evenAppConflictMessage: string; evenAppConflictWarningVisible: boolean; firmwareWarningMessage: string; @@ -1122,7 +1120,6 @@ class DashboardController { activeTextEditorToggleValue: this.activeTextEditorToggle?.setting.get() ?? false, activeTextEditorToggleVisible: this.activeTextEditorToggle !== null, keyboardInputActive: this.keyboardInput !== null, - keyboardInputTargets: this.keyboardInput?.targets ?? [], evenAppConflictMessage: this.evenAppConflictMessage, evenAppConflictWarningVisible: this.evenAppConflictMessage.length > 0, firmwareWarningMessage: this.firmwareWarningMessage, @@ -1321,23 +1318,9 @@ class DashboardController { shell.startKeyboardInput(); } - /** The phone's typing panel changed: mirror the text on the glasses. */ - setKeyboardInputText(text: string): void { - shell.noteUserActivity(); - this.keyboardInput?.setText(text); - } - - /** Send to one destination, or (no id: the IME's send key) the one highlighted on the glasses. */ - sendKeyboardInput(targetId?: string): void { - if (targetId) { - this.keyboardInput?.sendTo(targetId); - } else { - this.keyboardInput?.send(); - } - } - - discardKeyboardInput(): void { - this.keyboardInput?.discard(); + /** The open keyboard dialog, for the phone's typing panel (KeyboardInputViewModel). */ + get keyboardInputSession(): KeyboardInputSession | null { + return this.keyboardInput; } setActiveTextEditorToggleValue(value: boolean): void { diff --git a/app/g2/ios-preview-controller.ts b/app/g2/ios-preview-controller.ts index 04ea57df..249b648d 100644 --- a/app/g2/ios-preview-controller.ts +++ b/app/g2/ios-preview-controller.ts @@ -131,6 +131,8 @@ export class IosPreviewController { private clockMinute = -1 private shellRenderInProgress = false private shellRenderQueued = false + /** The shell woke; the next shell render unblanks the compositor after submitting. */ + private unblankAfterShellRender = false private nextFrameId = 1 private nextWorkerFrame = 0 private inputQueue: Promise = Promise.resolve() @@ -199,6 +201,9 @@ export class IosPreviewController { send: () => { if (this.active && !this.glassesLocked) session.send() }, sendTo: id => { if (this.active && !this.glassesLocked) session.sendTo(id) }, discard: () => session.discard(), + get visibility() { return session.visibility }, + setVisibility: visibility => { if (this.active && !this.glassesLocked) session.setVisibility(visibility) }, + get history() { return session.history }, } : null), prepareVoiceCapture: () => this.prepareVoiceCapture(), getScreenTimeoutMs: () => null, @@ -211,7 +216,12 @@ export class IosPreviewController { }, onScreenStateChanged: on => { if (on) this.glance.dismiss() - void this.display?.setScreenBlanked(!on).catch(error => this.fail(error)) + // A wake unblanks only once the next shell render has staged an awake + // scene: unblanking composites the retained one, painted while asleep + // with no chrome and depth 0, and that first frame is the one the + // brightness fade-in starts on. + this.unblankAfterShellRender = on + if (!on) void this.display?.setScreenBlanked(true).catch(error => this.fail(error)) this.requestShellRender() }, }) @@ -521,10 +531,19 @@ export class IosPreviewController { await this.displayReady const display = this.display if (!display) return - const startedAt = Date.now() - const bytes = shell.paintScene() + // Taken with the paint, so a render that painted before the wake can't unblank. + const unblank = this.unblankAfterShellRender + this.unblankAfterShellRender = false const frameId = this.allocateFrameId() - await display.submitShellScene(bytes, Date.now() - startedAt, frameId) + try { + const startedAt = Date.now() + const bytes = shell.paintScene() + await display.submitShellScene(bytes, Date.now() - startedAt, frameId) + } finally { + // Even if the render failed, so the screen doesn't stay dark; not if it + // went back to sleep meanwhile (that sleep re-blanked). + if (unblank && shell.isScreenOn()) await display.setScreenBlanked(false) + } // Backpressure: the next shell render waits for this one to reach the // glasses (the preview target resolves immediately; nothing transmits). await display.waitForFrameFinished(frameId, FRAME_TRANSMIT_BACKPRESSURE_TIMEOUT_MS) diff --git a/app/phone-ui/keyboard-input-panel.xml b/app/phone-ui/keyboard-input-panel.xml index bd36734d..412f383f 100644 --- a/app/phone-ui/keyboard-input-panel.xml +++ b/app/phone-ui/keyboard-input-panel.xml @@ -1,18 +1,40 @@ -