Issue #363 hopefully fixed a crash on amazon tvs while entering preferences screen

This commit is contained in:
Sergey Eremin
2018-01-14 03:39:35 +03:00
parent dbcfc64c36
commit d7dabcbd1f

View File

@@ -13,6 +13,9 @@ public class ThemeManager {
switch (theme) {
default:
case PreferenceActivity.THEME_NONE:
if (isAmazonTv(activity)) {
activity.setTheme(getThemeDark());
}
break;
case PreferenceActivity.THEME_LIGHT:
activity.setTheme(getThemeLight());
@@ -46,4 +49,8 @@ public class ThemeManager {
return android.R.style.Theme;
}
}
static private boolean isAmazonTv(Activity activity) {
return ((YalpStoreApplication) activity.getApplication()).isTv() && Build.MANUFACTURER.toLowerCase().contains("amazon");
}
}