use DayNight theme for splas screen

it doesn’t seem to be possible to make the splash screen use the configured
theme but we can follow the system’s theme on supported Android versions
This commit is contained in:
Daniel Gultsch 2021-01-26 08:34:42 +01:00
parent 8abf861303
commit 8e57a7622c
4 changed files with 12 additions and 4 deletions

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/grey50"/> <item android:drawable="@color/splash_screen_background" />
<item> <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
android:src="@drawable/splash_logo"/> android:src="@drawable/splash_logo" />
</item> </item>
</layer-list> </layer-list>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="splash_screen_background">#ff424242</color> <!-- gray800 -->
<color name="splash_screen_status_bar">#ff282828</color> <!-- gray900 -->
</resources>

View file

@ -40,5 +40,8 @@
<!-- scanner --> <!-- scanner -->
<color name="scan_result_dots">#c04CAF50</color> <color name="scan_result_dots">#c04CAF50</color>
<color name="splash_screen_background">#fffafafa</color> <!-- gray50 -->
<color name="splash_screen_status_bar">#ffe0e0e0</color> <!-- gray300 -->
<color name="blue500">#ff2196f3</color> <color name="blue500">#ff2196f3</color>
</resources> </resources>

View file

@ -363,8 +363,8 @@
<item name="android:navigationBarColor" tools:targetApi="21">@color/black</item> <item name="android:navigationBarColor" tools:targetApi="21">@color/black</item>
</style> </style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> <style name="SplashTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimaryDark">@color/grey300</item> <item name="colorPrimaryDark">@color/splash_screen_status_bar</item>
<item name="android:windowBackground">@drawable/background</item> <item name="android:windowBackground">@drawable/background</item>
</style> </style>