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

Toplevel - Fix system theme not being applied at launch on some platforms #16159

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Jun 28, 2024

What does the pull request do?

Platform Binding of ActualThemeVariantProperty is moved from WindowBase up to TopLevel, thus setting it for all supported platforms.

On Android, remove the visibility check when setting system bar theme, so it's now always set. I haven't noticed any adverse side effects of this change,

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #16065

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0049623-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@emmauss emmauss force-pushed the fix/toplevel_system_theme branch from d00ae78 to b98aefb Compare June 28, 2024 18:11
@maxkatz6 maxkatz6 added bug os-android backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Jun 28, 2024
@maxkatz6 maxkatz6 merged commit 3b235f9 into master Jun 28, 2024
12 checks passed
@maxkatz6 maxkatz6 deleted the fix/toplevel_system_theme branch June 28, 2024 20:15
@kerams
Copy link

kerams commented Jul 4, 2024

I suspect this broke on the fly theme switching (i.e. automatic reaction to a theme switch via the system bar) for me on Android. 11.2.999-cibuild0049474-alpha from the 26th works fine, 11.2.999-cibuild0049782-alpha from today doesn't.

@emmauss
Copy link
Contributor Author

emmauss commented Jul 4, 2024

I suspect this broke on the fly theme switching (i.e. automatic reaction to a theme switch via the system bar) for me on Android. 11.2.999-cibuild0049474-alpha from the 26th works fine, 11.2.999-cibuild0049782-alpha from today doesn't.

Are you detecting the system theme using the status bar and then applying your theme? There's already a better way of detecting system theme changes.

@kerams
Copy link

kerams commented Jul 4, 2024

No, I am using Material.Styles and not explicitly handling configuration changes. With 11.2.999-cibuild0049474-alpha, if I change the system theme from the status bar on top, my application theme automatically changes too. It no longer does in 11.2.999-cibuild0049782-alpha.

@emmauss
Copy link
Contributor Author

emmauss commented Jul 5, 2024

No, I am using Material.Styles and not explicitly handling configuration changes. With 11.2.999-cibuild0049474-alpha, if I change the system theme from the status bar on top, my application theme automatically changes too. It no longer does in 11.2.999-cibuild0049782-alpha.

Could you create an issue with a repro for me to look at?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch bug os-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android SystemBar Icons theme (Light, Dark) in 11.1.0-rc1
4 participants