Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using nested ElementTheme can set a wrong system bar color #1222

Closed
jmartinesp opened this issue Sep 5, 2023 · 3 comments · Fixed by #1225
Closed

Using nested ElementTheme can set a wrong system bar color #1222

jmartinesp opened this issue Sep 5, 2023 · 3 comments · Fixed by #1225
Assignees
Labels
O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@jmartinesp
Copy link
Contributor

Steps to reproduce

  1. Set your theme to light mode.
  2. Log in.

Outcome

What did you expect?

The status bar icons to be visible and the navbar to have the right color.

What happened instead?

The status bar icons are not visible, the navbar uses the dark theme colors.

This happens because the ElementTheme composable sets the system bars colors when it's used, but we have no way to restore them to the previous ones when it exits the composition, or when a parent theme becomes the top most item.

migration_screen_white_statusbar.mp4

I have only detected it here, but it can happen in other parts of the app where we force a dark theme.

Your phone model

OnePlus 6T

Operating system version

Android 11

Application version and app store

Element X (develop)

Homeserver

No response

Will you send logs?

No

Are you willing to provide a PR?

Yes

@jmartinesp jmartinesp added S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience labels Sep 5, 2023
@bmarty
Copy link
Member

bmarty commented Sep 5, 2023

We should use ForcedDarkElementTheme instead of ElementTheme here.

@jmartinesp
Copy link
Contributor Author

We should use ForcedDarkElementTheme instead of ElementTheme here.

TIL 🤯

@bmarty bmarty self-assigned this Sep 5, 2023
@bmarty
Copy link
Member

bmarty commented Sep 5, 2023

I will draft a small PR to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants