From c1bed35bcfcbe59134d6a4610c254b334d4ac747 Mon Sep 17 00:00:00 2001 From: tehcneko <7764726+tehcneko@users.noreply.github.com> Date: Wed, 19 May 2021 19:36:49 +0800 Subject: [PATCH] [app] Make background color follow system theme (#634) --- .../lsposed/manager/util/theme/ThemeUtil.java | 3 ++ .../res/values-night-v31/colors_custom.xml | 1 + .../main/res/values-night/colors_custom.xml | 1 - app/src/main/res/values-v31/colors_custom.xml | 1 + app/src/main/res/values-v31/themes_custom.xml | 38 +++++++++++++++++++ app/src/main/res/values/colors_custom.xml | 1 + app/src/main/res/values/themes_custom.xml | 4 +- 7 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/values-v31/themes_custom.xml diff --git a/app/src/main/java/org/lsposed/manager/util/theme/ThemeUtil.java b/app/src/main/java/org/lsposed/manager/util/theme/ThemeUtil.java index aaf40922..fee9137f 100644 --- a/app/src/main/java/org/lsposed/manager/util/theme/ThemeUtil.java +++ b/app/src/main/java/org/lsposed/manager/util/theme/ThemeUtil.java @@ -98,6 +98,9 @@ public class ThemeUtil { } public static String getColorTheme() { + if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.S || Build.VERSION.SDK_INT == Build.VERSION_CODES.R && Build.VERSION.PREVIEW_SDK_INT != 0) && isSystemAccent()) { + return "system"; + } String primaryColorEntryName = "COLOR_PRIMARY"; String colorPrimary = preferences.getString("theme_color", "COLOR_PRIMARY"); for (CustomThemeColors color : CustomThemeColors.values()) { diff --git a/app/src/main/res/values-night-v31/colors_custom.xml b/app/src/main/res/values-night-v31/colors_custom.xml index 453932bd..ff6e2526 100644 --- a/app/src/main/res/values-night-v31/colors_custom.xml +++ b/app/src/main/res/values-night-v31/colors_custom.xml @@ -21,4 +21,5 @@ @android:color/system_accent1_200 + @android:color/system_neutral1_800 diff --git a/app/src/main/res/values-night/colors_custom.xml b/app/src/main/res/values-night/colors_custom.xml index 25570ddd..4e422a04 100644 --- a/app/src/main/res/values-night/colors_custom.xml +++ b/app/src/main/res/values-night/colors_custom.xml @@ -39,5 +39,4 @@ @color/material_brown_200 @color/material_grey_200 @color/material_blue_grey_200 - @color/material_blue diff --git a/app/src/main/res/values-v31/colors_custom.xml b/app/src/main/res/values-v31/colors_custom.xml index 0c90d821..366fa2eb 100644 --- a/app/src/main/res/values-v31/colors_custom.xml +++ b/app/src/main/res/values-v31/colors_custom.xml @@ -21,4 +21,5 @@ @android:color/system_accent1_500 + @android:color/system_neutral1_50 diff --git a/app/src/main/res/values-v31/themes_custom.xml b/app/src/main/res/values-v31/themes_custom.xml new file mode 100644 index 00000000..3ca35dc6 --- /dev/null +++ b/app/src/main/res/values-v31/themes_custom.xml @@ -0,0 +1,38 @@ + + + + + + + + + + diff --git a/app/src/main/res/values/colors_custom.xml b/app/src/main/res/values/colors_custom.xml index 652dc4fc..18d2e883 100644 --- a/app/src/main/res/values/colors_custom.xml +++ b/app/src/main/res/values/colors_custom.xml @@ -40,4 +40,5 @@ @color/material_grey_500 @color/material_blue_grey_500 @color/material_blue + @color/material_blue diff --git a/app/src/main/res/values/themes_custom.xml b/app/src/main/res/values/themes_custom.xml index 72587cf1..dd265425 100644 --- a/app/src/main/res/values/themes_custom.xml +++ b/app/src/main/res/values/themes_custom.xml @@ -99,7 +99,5 @@ @color/material_blue_grey - +