From e6295be411aa4233de0db4e7a9e0515621d25a1a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Nov 2013 11:46:25 +0400 Subject: [PATCH] set article content webview font size properly --- src/org/fox/ttrss/ArticleFragment.java | 8 +++++--- src/org/fox/ttrss/offline/OfflineArticleFragment.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/org/fox/ttrss/ArticleFragment.java b/src/org/fox/ttrss/ArticleFragment.java index d2b94b98..9cca02c6 100644 --- a/src/org/fox/ttrss/ArticleFragment.java +++ b/src/org/fox/ttrss/ArticleFragment.java @@ -235,15 +235,17 @@ public class ArticleFragment extends Fragment { String align = m_prefs.getBoolean("justify_article_text", true) ? "text-align : justify;" : ""; + cssOverride += "body { "+align+" } "; + switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) { case 0: - cssOverride += "body { "+align+" font-size : 14px; } "; + ws.setDefaultFontSize(13); break; case 1: - cssOverride += "body { "+align+" font-size : 16px; } "; + ws.setDefaultFontSize(16); break; case 2: - cssOverride += "body { "+align+" font-size : 20px; } "; + ws.setDefaultFontSize(18); break; } diff --git a/src/org/fox/ttrss/offline/OfflineArticleFragment.java b/src/org/fox/ttrss/offline/OfflineArticleFragment.java index 248827cd..a35982d0 100644 --- a/src/org/fox/ttrss/offline/OfflineArticleFragment.java +++ b/src/org/fox/ttrss/offline/OfflineArticleFragment.java @@ -262,15 +262,17 @@ public class OfflineArticleFragment extends Fragment { String align = m_prefs.getBoolean("justify_article_text", true) ? "text-align : justified" : ""; + cssOverride += "body { "+align+" } "; + switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) { case 0: - cssOverride += "body { "+align+"; font-size : 14px; } "; + ws.setDefaultFontSize(13); break; case 1: - cssOverride += "body { "+align+"; font-size : 16px; } "; + ws.setDefaultFontSize(16); break; case 2: - cssOverride += "body { "+align+"; font-size : 20px; } "; + ws.setDefaultFontSize(18); break; }