Repository navigation
Conversation
…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>
MiMoHo
force-pushed
the
fix/force-dark
branch
from
September 9, 2026 15:22
be775f3 to
183cee1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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