hehe
hehe

Reputation: 775

Splash screen background turns to grey in Android App(Apache cordova) on miui (13.0.10)

I am using Apache cordova to create an app. My splash screen background is set to white however when dark mode is enabled it becomes greyish.

It is white when I change it to light mode.

config.xml

<platform name="android">
    <preference name="AndroidWindowSplashScreenAnimatedIcon" value="res/screen/android/splashscreen.png" />
    <preference name="AndroidWindowSplashScreenDuration" value="-1" /> <!-- Duration in milliseconds -->
    <preference name="SplashScreenBackgroundColor" value="#ffffff" /> <!-- Background color -->
</platform>

I am on miui 13.0.10

Ideally I want an animated icon, slightly bobbing up and down but currently it is a static image which is still not working.

Upvotes: 1

Views: 242

Answers (2)

hehe
hehe

Reputation: 775

Although it appears that there is no direct way of doing this, I used the foreground (i.e. the splashscreen with a background) of the splashscreen image as the splashcreen, with a color pallate that works regardless of if the background is black or white, which makes it look fine.

Upvotes: 0

Manjunath Karamudi
Manjunath Karamudi

Reputation: 100

You can try to create 2 different activities one for day and other for night mode. Use Specific assets for night and day modes with drawable-night and drawable asset folders

and in config.xml use preference

<preference name="splashscreen" value="@drawable/icon" /> <preference name="splashscreen" qualifier="night" value="@drawable-night/icon" /> 

and still if it doesn't work...

I think it's Miui which has default dark Mode properties and wouldn't let third-party apps modify it.

MiUi have their own dark mode implementations that might not always respect app themes perfectly.

Upvotes: 1

Related Questions