You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
something changed with Splashscreens and dark/light theming. I don't know when but i'm sure i had this working in my app. I use the Xamarin.AndroidX.Core.SplashScreen 1.0.1.12 nuget, because i need to display the splash a little bit longer and different colors for dark/light theme.
What i did:
In my csproj file i removed the MauiSplashScreen section.
In Platforms/Android/Resources i created values and values-night folder with styles.xml and colors.xml
In MainActivity.cs i set: [Activity(Theme = "@style/Theme.Splash", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
In MauiProgram.cs i call installSplashScreen:
If i run the app the colors in the splashscreen are correct. Depending what i set in styles.xml/colors.xml and if device is in dark/light mode.
For example my styles.xml in values-night for dark mode:
$${\color{#0bbd8b}0bbd8b \space is \space this \space color}$$
This is the SplashScreen in dark-mode:
The colors are correct. Butt problem is, when i switch the device from dark to light theme via system settings and the app is running the colors for statusBarColor and navigationBarColor are not changed to the values i set in Android/Resources/values/colors.xml. I have to restart the app to change the colors. Same happens if i change from light to dark mode.
The screenshot shows after changing from dark to light. StatusBar and NavigationBar are have still the dark theme colors:
I'm sure that this worked some time ago.
Steps to Reproduce
Open sample app
Change device theme
Go back to app
Statusbar and Navigationbar should changed the colors.
Description
Hi,
something changed with Splashscreens and dark/light theming. I don't know when but i'm sure i had this working in my app. I use the Xamarin.AndroidX.Core.SplashScreen 1.0.1.12 nuget, because i need to display the splash a little bit longer and different colors for dark/light theme.
What i did:
In my csproj file i removed the MauiSplashScreen section.
In Platforms/Android/Resources i created values and values-night folder with styles.xml and colors.xml
In MainActivity.cs i set:
[Activity(Theme = "@style/Theme.Splash", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
In MauiProgram.cs i call installSplashScreen:
If i run the app the colors in the splashscreen are correct. Depending what i set in styles.xml/colors.xml and if device is in dark/light mode.
For example my styles.xml in values-night for dark mode:
And my colors.xml in values-night:
This is the SplashScreen in dark-mode:
The colors are correct. Butt problem is, when i switch the device from dark to light theme via system settings and the app is running the colors for statusBarColor and navigationBarColor are not changed to the values i set in Android/Resources/values/colors.xml. I have to restart the app to change the colors. Same happens if i change from light to dark mode.
The screenshot shows after changing from dark to light. StatusBar and NavigationBar are have still the dark theme colors:
I'm sure that this worked some time ago.
Steps to Reproduce
Open sample app
Change device theme
Go back to app
Statusbar and Navigationbar should changed the colors.
MauiApp14.zip
Link to public reproduction project repository
No response
Version with bug
8.0.92 SR9.2
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: