Use untranslatable string when storing theme

This fixes #30
This commit is contained in:
tonymanou
2017-01-04 23:11:09 +01:00
committed by topjohnwu
parent 93598d3a51
commit ef2e02098d
9 changed files with 23 additions and 9 deletions

View File

@@ -164,6 +164,10 @@ public class Utils {
return null;
}
public static boolean isDarkTheme(String theme, Context resources) {
return theme != null && theme.equalsIgnoreCase(resources.getString(R.string.theme_dark_value));
}
public static class ByteArrayInOutStream extends ByteArrayOutputStream {
public ByteArrayInputStream getInputStream() {
ByteArrayInputStream in = new ByteArrayInputStream(buf, 0, count);

View File

@@ -14,7 +14,7 @@ public class WebWindow {
public WebWindow(String title, String url, Context context) {
AlertDialog.Builder alert;
String theme = PreferenceManager.getDefaultSharedPreferences(context).getString("theme", "");
if (theme.equals("Dark")) {
if (Utils.isDarkTheme(theme, context)) {
alert = new AlertDialog.Builder(context, R.style.AlertDialog_dh);
} else {
alert = new AlertDialog.Builder(context);