Only make navbar and status bar transparent on 21+

There is no easy way to handle insets pre 21, forget about it
This commit is contained in:
topjohnwu 2020-08-27 04:07:34 -07:00
parent fb3f8605fd
commit b4e8860ee4
3 changed files with 12 additions and 17 deletions

View File

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="SplashTheme" parent="SplashThemeBase">
<style name="SplashTheme" parent="SplashThemeBase.V19" />
<style name="Foundation.Compat">
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style> </style>
</resources> </resources>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Foundation.Compat">
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
</resources>

View File

@ -1,22 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"> <resources>
<style name="SplashThemeBase" parent="android:Theme.DeviceDefault.NoActionBar"> <style name="SplashThemeBase" parent="android:Theme.DeviceDefault.NoActionBar">
<item name="android:windowBackground">@drawable/ic_splash_activity</item> <item name="android:windowBackground">@drawable/ic_splash_activity</item>
</style> </style>
<style name="SplashThemeBase.V19" parent="SplashThemeBase">
<item name="android:windowTranslucentStatus" tools:targetApi="19">true</item>
<item name="android:windowTranslucentNavigation" tools:targetApi="19">true</item>
</style>
<style name="SplashTheme" parent="SplashThemeBase" /> <style name="SplashTheme" parent="SplashThemeBase" />
<style name="Foundation" parent="Theme.MaterialComponents.Light.NoActionBar"> <style name="Foundation" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">?colorSurface</item> <item name="android:windowBackground">?colorSurface</item>
</style> </style>
<!--This should be overridden in v19 for transparency, etc--> <!--This should be overridden in v21 for transparency, etc-->
<style name="Foundation.Compat" /> <style name="Foundation.Compat" />
<!--region Do not remove--> <!--region Do not remove-->
@ -24,9 +19,6 @@
<style name="WidgetFoundation" parent="android:Widget" /> <style name="WidgetFoundation" parent="android:Widget" />
<!-- {@deprecated Use WidgetFoundation instead.} -->
<style name="Widget" parent="WidgetFoundation" />
<style name="AppearanceFoundation"> <style name="AppearanceFoundation">
<item name="android:fontFamily">@font/exo</item> <item name="android:fontFamily">@font/exo</item>
</style> </style>