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

Splash screen background color is always black if dark mode is on #1485

Open
geshub opened this issue Sep 8, 2022 · 13 comments
Open

Splash screen background color is always black if dark mode is on #1485

geshub opened this issue Sep 8, 2022 · 13 comments
Milestone

Comments

@geshub
Copy link

geshub commented Sep 8, 2022

Bug Report

Problem

With the new splash screen API configured correctly I always get a black background color on the splash screen if my device is in dark mode.

What is expected to happen?

I expect to have my splash screen background color set to AndroidWindowSplashScreenBackground or have another way to set it for dark mode.

What does actually happen?

Background color is correct when dark mode is off but always black if on.

Information

Tested on device

Environment, Platform, Device

Mi 11 - Android 12

Version information

Using Ionic framework

Checklist

  • [x ] I searched for existing GitHub issues
  • [x ] I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above
@breautek
Copy link
Contributor

Android documentation for anyone willing to explore implementing DayNight themes for proper dark mode support: https://developer.android.com/develop/ui/views/theming/darktheme#launch_screens

@geshub
Copy link
Author

geshub commented Sep 29, 2022

I've just tested in an Android 12 simulator and splash screen got the correct color on light / dark mode.
The problem occurs on device ( Xiaomi 11 - Android 12 ), so it might be related to MIUI.
Could anyone confirms if the slash screen background color is working on a Xiaomi device with dark mode activated ?

@SidiBecker
Copy link

Same issue here, Xiaomi, Redmi Note 10 Pro

@SidiBecker
Copy link

SidiBecker commented Oct 25, 2022

In the same device, the .png image I set in AndroidWindowSplashScreenAnimatedIcon appears square instead of circular, like on other devices.

@niravparsana94
Copy link

Xiaomi - Redmi Note 10 Pro.
"AndroidWindowSplashScreenBackground" value is not respected.
How can I have a same color for both light and dark mode?

@daniel-gm-santos
Copy link

Xiaomi - Redmi Note 10 Pro. "AndroidWindowSplashScreenBackground" value is not respected. How can I have a same color for both light and dark mode?

Seems to be a common problem for Xiaomi mobiles... Would also love to know how to work around this...

@jeanribeirov
Copy link

Same issue here, Xiaomi Redmi Note 11... I would like a possible solution

@geshub
Copy link
Author

geshub commented Feb 20, 2023

Setting the android:windowBackground to the desired color in the splash screen theme fixes the issue (Tested on a Redmi note 10s).

Are you on Android 12 ?

@geshub
Copy link
Author

geshub commented Feb 20, 2023

yes, on android 12 with miui 13

Thanks, do you have any other variables set for dark mode, because I've got android:windowBackground set in a theme.xml and it's still black when dark mode is on ?

@rsteimen
Copy link

rsteimen commented May 3, 2023

We could reproduce this issue on Xiaomi Redmi 9A (M2006C3LG) with Android 11 (RP1A.200720.011), and both MIUI 12.5.3, 12.5.7. Our app works fine in light mode.

Suggested fix by @DeVictorVH didn't worked. The custom color for android:windowBackground was shown in light mode but in dark mode the display remained black. As a workaround we disabled dark mode for our app in "Settings - Display - More dark mode options" on problematic devices.

@MoraesFausto
Copy link

Same issue here, both splash screen color and png image are showing the expected behaviour on light mode. Although, the image is being displayed in a square format and the screen color gets black when on dark mode.
Does anyone know a way to prevent dark mode from being activated in this case?

@SWRHARD
Copy link

SWRHARD commented May 29, 2023

Same issue, try to add:
uiManager.setApplicationNightMode(MODE_NIGHT_NO) or setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO), but nothing is changed
Device info: Redmi Note 10S MIUI Global 14.0.1 Android 13

@ubarua123
Copy link

This is a huge issue in Miui.. and no user goes in the system settings and turns off dark mode for a single app. So now my app looks broken right at the splash screen. Any working solution would be welcome here.

@breautek breautek added this to the 13.x milestone Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants