force dark theme for images pager

This commit is contained in:
Andrew Dolgov 2015-02-12 19:55:39 +03:00
parent d6ba1550e9
commit 29f105b14e
2 changed files with 13 additions and 2 deletions

View File

@ -244,7 +244,8 @@ public class ArticleImagesPagerActivity extends CommonActivity implements Gestur
// we use that before parent onCreate so let's init locally
m_prefs = PreferenceManager
.getDefaultSharedPreferences(getApplicationContext());
setAppTheme(m_prefs);
setDarkAppTheme(m_prefs);
super.onCreate(savedInstanceState);

View File

@ -201,6 +201,16 @@ public class CommonActivity extends ActionBarActivity {
}
}
protected void setDarkAppTheme(SharedPreferences prefs) {
String theme = prefs.getString("theme", CommonActivity.THEME_DEFAULT);
if (theme.equals(THEME_AMBER)) {
setTheme(R.style.AmberTheme);
} else {
setTheme(R.style.DarkTheme);
}
}
@SuppressWarnings("deprecation")
@SuppressLint("NewApi")
protected int getScreenWidthInPixel() {