Skip to content

Opt keyboard views out of Force Dark to prevent inverted colors - #901

Open
MiMoHo wants to merge 1 commit into
openboard-team:masterfrom
MiMoHo:fix/force-dark
Open

MiMoHo wants to merge 1 commit into
openboard-team:masterfrom
MiMoHo:fix/force-dark

Conversation

@MiMoHo

@MiMoHo MiMoHo commented Jul 6, 2026

Copy link
Copy Markdown

Summary

With the developer option "Override force-dark" (or vendor equivalents like some MIUI/ColorOS dark-mode implementations), HWUI force-inverts the keyboard's light themes, producing broken, partially inverted colors (#202). The keyboard ships its own dark themes, so Force Dark provides no benefit and only corrupts the carefully themed views.

Fix

Call View#setForceDarkAllowed(false) (API 29+) on the IME input view when it is set. This opts the whole input-view hierarchy — keyboard, suggestion strip, emoji palette, clipboard history — out of Force Dark. This is the same mitigation other AOSP-based keyboards use (HeliBoard ships an equivalent opt-out).

Testing

Built with the stock toolchain and smoke-tested on an Android 15 emulator: normal rendering, typing, suggestions and theme switching are unaffected (the call only has an effect while HWUI force-dark is active). I could not exercise the force-dark developer toggle itself in the emulator session, but the API is documented to do exactly this and takes effect purely on the HWUI side.

Fixes #202

🤖 Generated with Claude Code

…board-team#202)

With the developer option 'Override force-dark' (or vendor equivalents)
enabled, HWUI force-inverts the keyboard's light themes, producing
broken, partially inverted colors. The keyboard ships its own dark
themes, so Force Dark provides no benefit here.

Disable force dark on the IME input view hierarchy (API 29+), which
covers the keyboard, suggestion strip, emoji palette and clipboard
history views.

Fixes openboard-team#202

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dark mode issue

1 participant