From 688c22fe92134158638faad30e9d4045ff665bf6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 15 Oct 2013 18:53:05 +0400 Subject: [PATCH] fix article text color when using system theme --- src/org/fox/ttrss/ArticleFragment.java | 6 ++++-- src/org/fox/ttrss/offline/OfflineArticleFragment.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index c6d278cd..9378ea25 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -204,9 +204,11 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl TypedValue tv = new TypedValue(); getActivity().getTheme().resolveAttribute(R.attr.linkColor, tv, true); - if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) { + String theme = m_prefs.getString("theme", "THEME_DARK"); + + if ("THEME_DARK".equals(theme) || "THEME_SYSTEM".equals(theme)) { cssOverride = "body { background : transparent; color : #e0e0e0}"; - } else if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK_GRAY")) { + } else if ("THEME_DARK_GRAY".equals(theme)) { cssOverride = "body { background : transparent; color : #e0e0e0}"; } else { cssOverride = "body { background : transparent; }"; diff --git a/src/org/fox/ttrss/offline/OfflineArticleFragment.java b/src/org/fox/ttrss/offline/OfflineArticleFragment.java index e36bea8a..c3a175dc 100644 --- a/src/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -215,10 +215,12 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector. if (android.os.Build.VERSION.SDK_INT >= 11) { web.setLayerType(View.LAYER_TYPE_SOFTWARE, null); } + + String theme = m_prefs.getString("theme", "THEME_DARK"); - if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) { + if ("THEME_DARK".equals(theme) || "THEME_SYSTEM".equals(theme)) { cssOverride = "body { background : transparent; color : #e0e0e0}"; - } else if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK_GRAY")) { + } else if ("THEME_DARK_GRAY".equals(theme)) { cssOverride = "body { background : transparent; color : #e0e0e0}"; } else { cssOverride = "body { background : transparent; }";