I implemented a layout-less splash screen in my app following this tutorial: https://www.bignerdranch.com/blog/splash-screens-the-right-way/
I managed to change the color of the status bar for my MainActivity and even to make it fullscreen using a theme. However none of the methods I've tried are working with the splash screen. Maybe it's because it doesn't use a layout but directly a drawable as background:
<style
name="AppTheme"
parent="@android:style/Theme.Material.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:textColor">@color/textColor</item>
<item name="iconColor">@color/iconColor</item>
<item name="android:statusBarColor">@color/colorPrimaryDark</item>
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>
<style
name="SplashTheme"
parent="AppTheme">
<item name="android:windowBackground">@drawable/splash_screen</item>
</style>
I tried using a Fullscreen theme, setting android:statusBarColor in the theme used by the activity, I also tried the two following bits of code:
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(ContextCompat.getColor(this, android.R.color.transparent));
These 4 methods are working for my normal activity but not for the splash screen. Is there anything I can do?
EDIT: I'm targetting minSdkVersion 23