Different md3 accent color for light and dark mode
This commit is contained in:
parent
93cc50a0c3
commit
1061fe8bfc
3 changed files with 9 additions and 2 deletions
3
appthemehelper/src/main/java/code/name/monkey/appthemehelper/ThemeStore.kt
Executable file → Normal file
3
appthemehelper/src/main/java/code/name/monkey/appthemehelper/ThemeStore.kt
Executable file → Normal file
|
@ -6,7 +6,6 @@ import android.graphics.Color
|
||||||
import androidx.annotation.*
|
import androidx.annotation.*
|
||||||
import androidx.annotation.IntRange
|
import androidx.annotation.IntRange
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.content.res.ResourcesCompat
|
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil.isWindowBackgroundDark
|
import code.name.monkey.appthemehelper.util.ATHUtil.isWindowBackgroundDark
|
||||||
import code.name.monkey.appthemehelper.util.ATHUtil.resolveColor
|
import code.name.monkey.appthemehelper.util.ATHUtil.resolveColor
|
||||||
import code.name.monkey.appthemehelper.util.ColorUtil
|
import code.name.monkey.appthemehelper.util.ColorUtil
|
||||||
|
@ -207,7 +206,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
|
||||||
@ColorInt
|
@ColorInt
|
||||||
fun accentColor(context: Context): Int {
|
fun accentColor(context: Context): Int {
|
||||||
if (VersionUtils.hasS()) {
|
if (VersionUtils.hasS()) {
|
||||||
return ContextCompat.getColor(context, android.R.color.system_accent1_600)
|
return ContextCompat.getColor(context, R.color.m3_accent_color)
|
||||||
}
|
}
|
||||||
val desaturatedColor = prefs(context).getBoolean("desaturated_color", false)
|
val desaturatedColor = prefs(context).getBoolean("desaturated_color", false)
|
||||||
val color = prefs(context).getInt(
|
val color = prefs(context).getInt(
|
||||||
|
|
4
appthemehelper/src/main/res/values-night-v31/colors.xml
Normal file
4
appthemehelper/src/main/res/values-night-v31/colors.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="m3_accent_color">@android:color/system_accent1_200</color>
|
||||||
|
</resources>
|
4
appthemehelper/src/main/res/values-v31/colors.xml
Normal file
4
appthemehelper/src/main/res/values-v31/colors.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="m3_accent_color">@android:color/system_accent1_600</color>
|
||||||
|
</resources>
|
Loading…
Reference in a new issue