fixed some dark theme issues in message view. fixes #2939

This commit is contained in:
Daniel Gultsch 2018-04-05 07:40:41 +02:00
parent 0ccdbaff96
commit ceac602185
2 changed files with 14 additions and 1 deletions

View File

@ -431,7 +431,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) {

View File

@ -29,10 +29,12 @@
package eu.siacs.conversations.utils;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;
import android.support.annotation.StyleRes;
import eu.siacs.conversations.R;
import eu.siacs.conversations.ui.SettingsActivity;
@ -53,4 +55,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;
}
}
}