From 1061fe8bfc0e2823871b66cefa8489c6e1d84e1d Mon Sep 17 00:00:00 2001 From: Prathamesh More Date: Mon, 20 Sep 2021 10:53:33 +0530 Subject: [PATCH] Different md3 accent color for light and dark mode --- .../main/java/code/name/monkey/appthemehelper/ThemeStore.kt | 3 +-- appthemehelper/src/main/res/values-night-v31/colors.xml | 4 ++++ appthemehelper/src/main/res/values-v31/colors.xml | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) mode change 100755 => 100644 appthemehelper/src/main/java/code/name/monkey/appthemehelper/ThemeStore.kt create mode 100644 appthemehelper/src/main/res/values-night-v31/colors.xml create mode 100644 appthemehelper/src/main/res/values-v31/colors.xml diff --git a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/ThemeStore.kt b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/ThemeStore.kt old mode 100755 new mode 100644 index 12b60a0c..47e6226d --- a/appthemehelper/src/main/java/code/name/monkey/appthemehelper/ThemeStore.kt +++ b/appthemehelper/src/main/java/code/name/monkey/appthemehelper/ThemeStore.kt @@ -6,7 +6,6 @@ import android.graphics.Color import androidx.annotation.* import androidx.annotation.IntRange 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.resolveColor import code.name.monkey.appthemehelper.util.ColorUtil @@ -207,7 +206,7 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt @ColorInt fun accentColor(context: Context): Int { 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 color = prefs(context).getInt( diff --git a/appthemehelper/src/main/res/values-night-v31/colors.xml b/appthemehelper/src/main/res/values-night-v31/colors.xml new file mode 100644 index 00000000..5820630e --- /dev/null +++ b/appthemehelper/src/main/res/values-night-v31/colors.xml @@ -0,0 +1,4 @@ + + + @android:color/system_accent1_200 + \ No newline at end of file diff --git a/appthemehelper/src/main/res/values-v31/colors.xml b/appthemehelper/src/main/res/values-v31/colors.xml new file mode 100644 index 00000000..5fb206d5 --- /dev/null +++ b/appthemehelper/src/main/res/values-v31/colors.xml @@ -0,0 +1,4 @@ + + + @android:color/system_accent1_600 + \ No newline at end of file