android / android/nowinandroid

[Bug]: Text inside NiaBackground has wrong colors in some cases

Open
#939 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
21.8k
Forks
4.6k
Avg merge
19h 20m
Merged PRs (30d)
2

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is there a StackOverflow question about this issue?

- [X] I have searched StackOverflow

### What happened?

As seen in https://github.com/android/nowinandroid/issues/917, some NiaBackground screenshots don't show any text or they show it with very low contrast.

Chatted with @alexvanyo about this:
```
I wonder if we need to manually set the contentColor in the Surface - I think the default behavior is it tries to determine it from the background color, but maybe it doesn't work with our custom ones?
```

![image](https://github.com/android/nowinandroid/assets/609125/ef5105ab-293a-4d20-ac46-21c10a1b29e5)

### Relevant logcat output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Locate the NiaBackground composable and reproduce the low-contrast or missing text shown in the linked issue screenshot. Inspect how its Surface background and content color are resolved; done means text inside NiaBackground remains visible with sufficient contrast in the affected cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.