From 29f105b14ed6e78c6999bd5e896df934628af3df Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 12 Feb 2015 19:55:39 +0300 Subject: [PATCH] force dark theme for images pager --- .../org/fox/ttrss/ArticleImagesPagerActivity.java | 3 ++- .../src/main/java/org/fox/ttrss/CommonActivity.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java index c6f76e5a..62ef5278 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java @@ -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); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java index 44c122d8..06d9e1ad 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java @@ -200,7 +200,17 @@ public class CommonActivity extends ActionBarActivity { setTheme(R.style.LightTheme); } } - + + 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() {