feat: Add white and black text color options for digital widgets - #552
Merged
Conversation
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
Adds pure White and Black text color options for both date and time in digital clock widgets (
DigitalClockWidgetandVerticalClockWidget), giving users high-contrast monochrome choices alongside dynamic Material You theme colors.Closes #528
Technical Details & Fixes
Direct Colors in
TextColor:White(Color.WHITE) andBlack(Color.BLACK) toTextColor.ktwith direct@ColorIntsupport so static colors are returned directly without needing theme attribute resolution.Fix for
Color.WHITEApplication in RemoteViews:DigitalClockWidget.ktandVerticalClockWidget.ktguardedsetTextColorwithif (timeColor != -1 && dateColor != -1)because-1was used as a fallback sentinel when resolving theme attributes.0xFFFFFFFF) is literally-1(Color.WHITE == -1), which caused pure white to be treated as an unresolved attribute and skipped.Color Picker Contrast & Swatch Outlines:
ClockWidgetConfig.ktso white swatches on light backgrounds and black swatches on dark/AMOLED backgrounds remain easily distinguishable.Verification
./gradlew assembleDebugpassed./gradlew installDebug)DigitalClockWidgetandVerticalClockWidget