From ee57ba7fba134428cd284b2a2f3010a9873c04cf Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 15 Apr 2024 18:49:27 +0200 Subject: [PATCH] app: use static variables to refer to config settings --- src/main/java/eu/siacs/conversations/AppSettings.java | 1 + src/main/java/eu/siacs/conversations/Conversations.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/AppSettings.java b/src/main/java/eu/siacs/conversations/AppSettings.java index 132a2bab8..b223e90e1 100644 --- a/src/main/java/eu/siacs/conversations/AppSettings.java +++ b/src/main/java/eu/siacs/conversations/AppSettings.java @@ -21,6 +21,7 @@ public class AppSettings { public static final String AUTOMATIC_MESSAGE_DELETION = "automatic_message_deletion"; public static final String BROADCAST_LAST_ACTIVITY = "last_activity"; public static final String THEME = "theme"; + public static final String DYNAMIC_COLORS = "dynamic_colors"; public static final String SHOW_DYNAMIC_TAGS = "show_dynamic_tags"; public static final String OMEMO = "omemo"; public static final String ALLOW_SCREENSHOTS = "allow_screenshots"; diff --git a/src/main/java/eu/siacs/conversations/Conversations.java b/src/main/java/eu/siacs/conversations/Conversations.java index 65ef020a7..8b564c0cf 100644 --- a/src/main/java/eu/siacs/conversations/Conversations.java +++ b/src/main/java/eu/siacs/conversations/Conversations.java @@ -48,13 +48,13 @@ public class Conversations extends Application { public static boolean isDynamicColorsDesired(final Context context) { final var preferences = PreferenceManager.getDefaultSharedPreferences(context); - return preferences.getBoolean("dynamic_colors", false); + return preferences.getBoolean(AppSettings.DYNAMIC_COLORS, false); } private static int getDesiredNightMode( final Context context, final SharedPreferences sharedPreferences) { final String theme = - sharedPreferences.getString("theme", context.getString(R.string.theme)); + sharedPreferences.getString(AppSettings.THEME, context.getString(R.string.theme)); return getDesiredNightMode(theme); }