Add Android 12 dynamic colors
This commit is contained in:
parent
f92efa31e8
commit
976b56ce00
4 changed files with 44 additions and 7 deletions
24
app/src/main/res/values-night-v31/themes.xml
Normal file
24
app/src/main/res/values-night-v31/themes.xml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="Theme.Findroid" parent="Base.Theme.Findroid">
|
||||||
|
<!-- Main colors -->
|
||||||
|
<item name="colorPrimary">@android:color/system_accent1_400</item>
|
||||||
|
<item name="colorPrimaryVariant">@android:color/system_accent1_800</item>
|
||||||
|
<item name="colorSecondary">@android:color/system_accent2_400</item>
|
||||||
|
<item name="colorSecondaryVariant">@android:color/system_accent2_800</item>
|
||||||
|
|
||||||
|
<!-- Background colors and error state color -->
|
||||||
|
<item name="android:colorBackground">@color/black</item>
|
||||||
|
<item name="colorSurface">@android:color/system_neutral1_900</item>
|
||||||
|
<item name="colorError">@color/red</item>
|
||||||
|
|
||||||
|
<!-- Text, icons and strokes in relation to the surface -->
|
||||||
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
|
<item name="colorOnSecondary">@color/black</item>
|
||||||
|
<item name="colorOnBackground">@color/white</item>
|
||||||
|
<item name="colorOnSurface">@color/white</item>
|
||||||
|
<item name="colorOnError">@color/white</item>
|
||||||
|
|
||||||
|
<item name="elevationOverlayEnabled">false</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<!-- Background colors and error state color -->
|
<!-- Background colors and error state color -->
|
||||||
<item name="android:colorBackground">@color/black</item>
|
<item name="android:colorBackground">@color/black</item>
|
||||||
<item name="colorSurface">@color/black</item>
|
<item name="colorSurface">@color/neutral_900</item>
|
||||||
<item name="colorError">@color/red</item>
|
<item name="colorError">@color/red</item>
|
||||||
|
|
||||||
<!-- Text, icons and strokes in relation to the surface -->
|
<!-- Text, icons and strokes in relation to the surface -->
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
<style name="Theme.FindroidSplashScreen" parent="Theme.SplashScreen">
|
<style name="Theme.FindroidSplashScreen" parent="Theme.SplashScreen">
|
||||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
||||||
<item name="windowSplashScreenBackground">@color/neutral_900</item>
|
<item name="windowSplashScreenBackground">@color/black</item>
|
||||||
<item name="postSplashScreenTheme">@style/Theme.Findroid</item>
|
<item name="postSplashScreenTheme">@style/Theme.Findroid</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
10
app/src/main/res/values-v31/themes.xml
Normal file
10
app/src/main/res/values-v31/themes.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="Theme.Findroid" parent="Base.Theme.Findroid">
|
||||||
|
<!-- Main colors -->
|
||||||
|
<item name="colorPrimary">@android:color/system_accent1_500</item>
|
||||||
|
<item name="colorPrimaryVariant">@android:color/system_accent1_800</item>
|
||||||
|
<item name="colorSecondary">@android:color/system_accent2_500</item>
|
||||||
|
<item name="colorSecondaryVariant">@android:color/system_accent2_800</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
|
@ -10,8 +10,8 @@
|
||||||
<item name="colorSecondaryVariant">@color/green_800</item>
|
<item name="colorSecondaryVariant">@color/green_800</item>
|
||||||
|
|
||||||
<!-- Background colors and error state color -->
|
<!-- Background colors and error state color -->
|
||||||
<item name="android:colorBackground">@color/neutral_100</item>
|
<item name="android:colorBackground">@color/white</item>
|
||||||
<item name="colorSurface">@color/neutral_100</item>
|
<item name="colorSurface">@color/white</item>
|
||||||
<item name="colorError">@color/red</item>
|
<item name="colorError">@color/red</item>
|
||||||
|
|
||||||
<!-- Text, icons and strokes in relation to the surface -->
|
<!-- Text, icons and strokes in relation to the surface -->
|
||||||
|
@ -22,16 +22,19 @@
|
||||||
<item name="colorOnError">@color/white</item>
|
<item name="colorOnError">@color/white</item>
|
||||||
|
|
||||||
<!-- Status bar -->
|
<!-- Status bar -->
|
||||||
<item name="android:statusBarColor">?android:attr/colorBackground</item>
|
<item name="android:statusBarColor">?attr/colorSurface</item>
|
||||||
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
|
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
|
||||||
|
|
||||||
<!-- Extra's -->
|
<!-- Navigation bar -->
|
||||||
|
<item name="android:navigationBarColor">?attr/colorSurface</item>
|
||||||
|
|
||||||
|
<!-- Toolbar -->
|
||||||
<item name="toolbarStyle">@style/Widget.MaterialComponents.Toolbar.Surface</item>
|
<item name="toolbarStyle">@style/Widget.MaterialComponents.Toolbar.Surface</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.FindroidSplashScreen" parent="Theme.SplashScreen">
|
<style name="Theme.FindroidSplashScreen" parent="Theme.SplashScreen">
|
||||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
||||||
<item name="windowSplashScreenBackground">@color/neutral_100</item>
|
<item name="windowSplashScreenBackground">@color/white</item>
|
||||||
<item name="postSplashScreenTheme">@style/Theme.Findroid</item>
|
<item name="postSplashScreenTheme">@style/Theme.Findroid</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue