4

I am implementing dark mode and I have a dark mode version of splash screen in drawable-night. Then in app's onCreate I call:

override fun onCreate() {
    super.onCreate()
    AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
}

However, it seems that the splash screen still follows the system settings and not the one I set. I tried doing the same in app's init but that yielded the same result. Is there a way to do this?

Taher Fattahi
  • 951
  • 1
  • 6
  • 14
mickp
  • 1,679
  • 7
  • 23

3 Answers3

2

It seems that it's not possible as of now.

Big applications like WhatsApp or Slack behave the same way and also don't have a dark splash screen unless the system-wide dark mode setting is on.

mickp
  • 1,679
  • 7
  • 23
1

On API 31 and above you can now use getSplashScreen().setSplashScreenTheme(int themeId). There is still no support for lower versions.

Osagui Aghedo
  • 330
  • 4
  • 12
0
override fun onCreate() {

AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)

super.onCreate()
}

Try this

John doe
  • 106
  • 11