From 9a22917951a9dacc9470633f94b769c4d7187943 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 29 Apr 2018 23:24:05 +0200 Subject: migrate recording activity to view binder --- src/main/java/de/pixart/messenger/utils/ThemeHelper.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/main/java/de/pixart/messenger/utils') diff --git a/src/main/java/de/pixart/messenger/utils/ThemeHelper.java b/src/main/java/de/pixart/messenger/utils/ThemeHelper.java index 3568a488a..27a48f069 100644 --- a/src/main/java/de/pixart/messenger/utils/ThemeHelper.java +++ b/src/main/java/de/pixart/messenger/utils/ThemeHelper.java @@ -59,6 +59,21 @@ public class ThemeHelper { } } + public static int findDialog(Context context) { + final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); + final Resources resources = context.getResources(); + final boolean dark = sharedPreferences.getString(SettingsActivity.THEME, resources.getString(R.string.theme)).equals("dark"); + final String fontSize = sharedPreferences.getString("font_size", resources.getString(R.string.default_font_size)); + switch (fontSize) { + case "medium": + return dark ? R.style.ConversationsTheme_Dark_Dialog_Medium : R.style.ConversationsTheme_Dialog_Medium; + case "large": + return dark ? R.style.ConversationsTheme_Dark_Dialog_Large : R.style.ConversationsTheme_Dialog_Large; + default: + return dark ? R.style.ConversationsTheme_Dark_Dialog: R.style.ConversationsTheme_Dialog; + } + } + public static boolean isDark(@StyleRes int id) { switch (id) { case R.style.ConversationsTheme_Dark: -- cgit v1.2.3