Support $Dark UIID styles in dark mode with implicit inheritance#4648
Merged
shai-almog merged 3 commits intomasterfrom Mar 28, 2026
Merged
Support $Dark UIID styles in dark mode with implicit inheritance#4648shai-almog merged 3 commits intomasterfrom
shai-almog merged 3 commits intomasterfrom
Conversation
Collaborator
Author
|
Compared 32 screenshots: 32 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
|
Collaborator
Author
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks:
Unused image preview:
|
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.

Motivation
$Darkprefix for a UIID if they exist.deriveon$Darkstyles to override the implicit inheritance behavior.Description
UIManager.createStyle(...)to checkCN.isDarkMode()and resolve to a$Dark<UIID>variant when present via a newshouldUseDarkStyle(...)helper.$Darkvariant exists but does not define its ownderive, the code now implicitly derives it from the original UIID usingtoDeriveStyleName(...), preserving existing explicitderivebehavior.hasStyleDefinition(...)to detect whether the dark variant is defined inthemeProps.maven/core-unittests/src/test/java/com/codename1/ui/plaf/UIManagerDarkModeStyleTest.javathat cover: dark-style override + inherited base properties, selected-style dark variants (sel#), explicit darkderiveoverriding implicit inheritance, and fallback to the regular style when no$Darkvariant exists; tests reset dark mode after each run.Testing
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 && export PATH="$JAVA_HOME/bin:$PATH" && cd maven && mvn -pl core-unittests -am -DunitTests=true -Dmaven.javadoc.skip=true -Plocal-dev-javase -Dtest=UIManagerDarkModeStyleTest testwhich failed because the referenced Java 8 path is not available in this environment.AGENTS.md(Java 8JAVA_HOME+ Maven access to central).Codex Task