apply dynamic color instead of leaving it as catima theme for invalid theme key

This commit is contained in:
Katharine Chui
2022-02-06 03:38:28 +08:00
parent c9b8b2df9e
commit 18e30d2726

View File

@@ -471,9 +471,7 @@ public class Utils {
Resources.Theme theme = activity.getTheme();
Resources resources = activity.getResources();
if (color.equals(resources.getString(R.string.settings_key_system_theme))) {
DynamicColors.applyIfAvailable(activity);
} else if (color.equals(resources.getString(R.string.settings_key_pink_theme))) {
if (color.equals(resources.getString(R.string.settings_key_pink_theme))) {
theme.applyStyle(R.style.pink, true);
} else if (color.equals(resources.getString(R.string.settings_key_magenta_theme))) {
theme.applyStyle(R.style.magenta, true);
@@ -489,6 +487,11 @@ public class Utils {
theme.applyStyle(R.style.brown, true);
} else if (color.equals(resources.getString(R.string.settings_key_catima_theme))) {
// catima theme is AppTheme itself, no dynamic colors nor applyStyle
} else if (color.equals(resources.getString(R.string.settings_key_system_theme))) {
DynamicColors.applyIfAvailable(activity);
} else {
// final catch all in case of invalid theme value from older versions
DynamicColors.applyIfAvailable(activity);
}
if (isDarkModeEnabled(activity) && settings.getOledDark()) {