Skip to content

Android DetailedList: use theme text colors (replace R.color.black)#3751

Merged
mhsmith merged 14 commits intobeeware:mainfrom
rasmusJenle:dl-darktext-fix
Jan 17, 2026
Merged

Android DetailedList: use theme text colors (replace R.color.black)#3751
mhsmith merged 14 commits intobeeware:mainfrom
rasmusJenle:dl-darktext-fix

Conversation

@rasmusJenle
Copy link
Copy Markdown
Contributor

@rasmusJenle rasmusJenle commented Sep 5, 2025

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

light_on_dark_android dark_on_light_android

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.

@rasmusJenle rasmusJenle marked this pull request as draft September 5, 2025 21:19
@rasmusJenle rasmusJenle marked this pull request as ready for review September 6, 2025 11:20
@rasmusJenle rasmusJenle marked this pull request as draft September 6, 2025 13:58
@rasmusJenle rasmusJenle marked this pull request as ready for review September 6, 2025 22:26
Copy link
Copy Markdown
Contributor

@johnzhou721 johnzhou721 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread android/src/toga_android/widgets/detailedlist.py Outdated
Comment thread android/src/toga_android/widgets/detailedlist.py Outdated
Comment thread android/src/toga_android/widgets/detailedlist.py Outdated
Comment thread android/src/toga_android/widgets/detailedlist.py Outdated
@mhsmith mhsmith self-requested a review September 8, 2025 09:54
Comment thread android/src/toga_android/widgets/detailedlist.py Outdated
Comment thread android/src/toga_android/widgets/detailedlist.py Outdated
Comment thread android/src/toga_android/widgets/detailedlist.py Outdated
Comment thread android/src/toga_android/widgets/detailedlist.py Outdated
@rasmusJenle
Copy link
Copy Markdown
Contributor Author

CI note

The Android testbed is currently failing during Gradle dependency resolution with repeated
HTTP 403 Forbidden responses from https://repo.maven.apache.org/maven2/ (protobuf, gson, grpc, etc.).
Windows testbed was green on the initial run; subsequent failures there appear flaky
(timing / environment related) and likely unrelated to this change, which is Android-specific.
I’ve retriggered CI to rule out transient issues.

@freakboy3742
Copy link
Copy Markdown
Member

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.

@freakboy3742 freakboy3742 requested a review from mhsmith January 7, 2026 22:02
Copy link
Copy Markdown
Member

@mhsmith mhsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@mhsmith mhsmith merged commit 9343e1f into beeware:main Jan 17, 2026
57 checks passed
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.

DetailedList text color hard-coded to black on Android (breaks dark mode)

4 participants