Use DayNight theme from material-components

This commit is contained in:
Mygod
2019-07-16 18:32:47 +08:00
parent cb5e8ee420
commit f599e2fe3d
5 changed files with 9 additions and 9 deletions

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="is_day">false</bool>
</resources>

View File

@@ -3,4 +3,6 @@
<color name="colorPrimary">#2e7d32</color>
<color name="colorPrimaryDark">#005005</color>
<color name="colorSecondary">#AEEA00</color>
<!-- This actually takes precedence over v27: https://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch -->
<color name="navigationBarColor">@android:color/black</color>
</resources>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MaterialComponents.DayNight.NoActionBar" parent="Theme.MaterialComponents.NoActionBar"/>
</resources>

View File

@@ -2,4 +2,5 @@
<resources>
<bool name="api_ge_26">false</bool>
<bool name="api_lt_25">true</bool>
<bool name="is_day">true</bool>
</resources>

View File

@@ -1,11 +1,8 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.MaterialComponents.DayNight.NoActionBar" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:navigationBarColor">@color/navigationBarColor</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">true</item>
</style>
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:navigationBarColor">@color/navigationBarColor</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">@bool/is_day</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorSecondary">@color/colorSecondary</item>