Android DetailedList: use theme text colors (replace R.color.black)#3751
Android DetailedList: use theme text colors (replace R.color.black)#3751mhsmith merged 14 commits intobeeware:mainfrom
Conversation
johnzhou721
left a comment
There was a problem hiding this comment.
Some unofficial suggestions. If you disagree with any of those or can't work them out, feel free to wait for a core team member.
…no CSL; raise if missing
|
CI note The Android testbed is currently failing during Gradle dependency resolution with repeated |
|
The CI issues were transient; GitHub apparently has a surprisingly difficult time maintaining connections to the internet. I've re-run CI, and it has all passed; but there is still a documentation build issue that I think will be resolved if you merge with main. |
Problem
On Android, DetailedList currently hard-codes R.color.black for row text.
In dark mode, this makes text unreadable (black text on dark background).
Fixes #3747.
Solution
Replace the hard-coded color with theme-resolved colors:
top_text: resolved from android.R.attr.textColorPrimary
bottom_text: resolved from android.R.attr.textColorSecondary
Fallback: Color.BLACK
Screenshots with solution implemented
As pointed out by freakboy3742 when the issue was raised, the decision whether to use textColorPrimary or textColorSecondary for bottom_text requires attention to android best practice. After looking at https://m3.material.io/components/lists/specs, I landed on textColorSecondary. top_text and bottom_text seem to work like a headline and supporting text, with varying emphases on color/contrast.