app: use static variables to refer to config settings
This commit is contained in:
parent
97eb7d4e48
commit
ee57ba7fba
|
@ -21,6 +21,7 @@ public class AppSettings {
|
||||||
public static final String AUTOMATIC_MESSAGE_DELETION = "automatic_message_deletion";
|
public static final String AUTOMATIC_MESSAGE_DELETION = "automatic_message_deletion";
|
||||||
public static final String BROADCAST_LAST_ACTIVITY = "last_activity";
|
public static final String BROADCAST_LAST_ACTIVITY = "last_activity";
|
||||||
public static final String THEME = "theme";
|
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 SHOW_DYNAMIC_TAGS = "show_dynamic_tags";
|
||||||
public static final String OMEMO = "omemo";
|
public static final String OMEMO = "omemo";
|
||||||
public static final String ALLOW_SCREENSHOTS = "allow_screenshots";
|
public static final String ALLOW_SCREENSHOTS = "allow_screenshots";
|
||||||
|
|
|
@ -48,13 +48,13 @@ public class Conversations extends Application {
|
||||||
|
|
||||||
public static boolean isDynamicColorsDesired(final Context context) {
|
public static boolean isDynamicColorsDesired(final Context context) {
|
||||||
final var preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
final var preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
return preferences.getBoolean("dynamic_colors", false);
|
return preferences.getBoolean(AppSettings.DYNAMIC_COLORS, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getDesiredNightMode(
|
private static int getDesiredNightMode(
|
||||||
final Context context, final SharedPreferences sharedPreferences) {
|
final Context context, final SharedPreferences sharedPreferences) {
|
||||||
final String theme =
|
final String theme =
|
||||||
sharedPreferences.getString("theme", context.getString(R.string.theme));
|
sharedPreferences.getString(AppSettings.THEME, context.getString(R.string.theme));
|
||||||
return getDesiredNightMode(theme);
|
return getDesiredNightMode(theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue