Issue
I added a splash screen to my android app and I'd like to give the status bar a color when showing.
This is the content of the file under drawable:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@color/colorPrimary" />
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/ic_home"/>
</item>
</layer-list>
and I added this style:
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splashscreen</item>
</style>
Solution
Adding the colorPrimaryDark
item to your theme should do the trick:
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splashscreen</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
</style>
Answered By - Jérémy Reynaud