set article content webview font size properly

This commit is contained in:
Andrew Dolgov 2013-11-21 11:46:25 +04:00
parent 0d6b35373d
commit e6295be411
2 changed files with 10 additions and 6 deletions

View File

@ -235,15 +235,17 @@ public class ArticleFragment extends Fragment {
String align = m_prefs.getBoolean("justify_article_text", true) ? "text-align : justify;" : ""; String align = m_prefs.getBoolean("justify_article_text", true) ? "text-align : justify;" : "";
cssOverride += "body { "+align+" } ";
switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) { switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) {
case 0: case 0:
cssOverride += "body { "+align+" font-size : 14px; } "; ws.setDefaultFontSize(13);
break; break;
case 1: case 1:
cssOverride += "body { "+align+" font-size : 16px; } "; ws.setDefaultFontSize(16);
break; break;
case 2: case 2:
cssOverride += "body { "+align+" font-size : 20px; } "; ws.setDefaultFontSize(18);
break; break;
} }

View File

@ -262,15 +262,17 @@ public class OfflineArticleFragment extends Fragment {
String align = m_prefs.getBoolean("justify_article_text", true) ? "text-align : justified" : ""; String align = m_prefs.getBoolean("justify_article_text", true) ? "text-align : justified" : "";
cssOverride += "body { "+align+" } ";
switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) { switch (Integer.parseInt(m_prefs.getString("font_size", "0"))) {
case 0: case 0:
cssOverride += "body { "+align+"; font-size : 14px; } "; ws.setDefaultFontSize(13);
break; break;
case 1: case 1:
cssOverride += "body { "+align+"; font-size : 16px; } "; ws.setDefaultFontSize(16);
break; break;
case 2: case 2:
cssOverride += "body { "+align+"; font-size : 20px; } "; ws.setDefaultFontSize(18);
break; break;
} }