aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-23 21:43:39 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-23 21:43:39 +0200
commit3e487b928d7969dbb1adac68771d8e8959dfad45 (patch)
treeb89a1ce8bad77b10a73b9f30f600c82d60d27c50 /src
parent6584625c9e7457a37a34584accca2ec543cdf582 (diff)
fixed some dark theme issues in message view
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/utils/ThemeHelper.java12
2 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index 5c104cada..613d18792 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -434,7 +434,7 @@ public abstract class XmppActivity extends AppCompatActivity {
}
public boolean isDarkTheme() {
- return this.mTheme == R.style.ConversationsTheme_Dark;
+ return ThemeHelper.isDark(mTheme);
}
public int getThemeResource(int r_attr_name, int r_drawable_def) {
diff --git a/src/main/java/de/pixart/messenger/utils/ThemeHelper.java b/src/main/java/de/pixart/messenger/utils/ThemeHelper.java
index 199e12d5e..c14e1e25d 100644
--- a/src/main/java/de/pixart/messenger/utils/ThemeHelper.java
+++ b/src/main/java/de/pixart/messenger/utils/ThemeHelper.java
@@ -33,6 +33,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;
+import android.support.annotation.StyleRes;
import de.pixart.messenger.R;
import de.pixart.messenger.ui.SettingsActivity;
@@ -53,4 +54,15 @@ public class ThemeHelper {
return dark ? R.style.ConversationsTheme_Dark : R.style.ConversationsTheme;
}
}
+
+ public static boolean isDark(@StyleRes int id) {
+ switch (id) {
+ case R.style.ConversationsTheme_Dark:
+ case R.style.ConversationsTheme_Dark_Large:
+ case R.style.ConversationsTheme_Dark_Medium:
+ return true;
+ default:
+ return false;
+ }
+ }
} \ No newline at end of file