I'm trying to create splash screen for android application with this article: Splash Screens the Right Way. As article says, I created LayerDrawable with two layers: background bitmap and logo (also bitmap). Logo need to be located at the bottom of screen with indent 32dp, for example. Here my drawable:
<item
android:drawable="@drawable/splash_image" />
<item
android:id="@+id/logo"
android:bottom="@dimen/margin_splash">
<bitmap
android:gravity="bottom|center"
android:src="@drawable/logo_green" />
</item>
I pointed this drawable as android:windowBackground
param in my splash activity theme. I also want to have transparent status bar when splash screen is shown on devices where this feature is supported (API >=19), so I created two resource files for different android versions and in values-v19\styles.xml I pointed flag android:windowTranslucentStatus
as true. Here my values/styles.xml
and values-v19/styles.xml
:
values/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/bg_splash</item>
</style>
</resources>
and
values-v19/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/bg_splash</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
</resources>
But on some Android devices with Soft NavigationBar my logo is overlapped by it.
I tried to point android:windowTranslucentNavigation
flag as false but without success.
Is any way to make Android Soft NavigationBar transparent together with transparent status bar, or I need detect Soft NavigationBar availability in onCreate method of my splash activity and update my LayerDrawable by adding bottom indent for logo to the height of NavigationBar?
Thanks.