use meta viewport for embedded webviews

This commit is contained in:
Andrew Dolgov 2011-11-30 19:04:31 +03:00
parent ee886a6a76
commit f16095ce53
2 changed files with 14 additions and 6 deletions

View File

@ -102,15 +102,19 @@ public class ArticleFragment extends Fragment implements OnClickListener {
String content; String content;
String cssOverride = ""; String cssOverride = "";
web.setBackgroundColor(0x00000000);
if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) { if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) {
web.setBackgroundColor(android.R.color.black); cssOverride = "body { background : transparent; color : #e0e0e0}\n";
cssOverride = "body { background : black; color : #f0f0f0}\n"; } else {
cssOverride = "body { background : transparent; }\n";
} }
content = content =
"<html>" + "<html>" +
"<head>" + "<head>" +
"<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" + "<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" +
"<meta name=\"viewport\" content=\"target-densitydpi=device-dpi\" />" +
"<style type=\"text/css\">" + "<style type=\"text/css\">" +
cssOverride + cssOverride +
"img { max-width : 90%; }" + "img { max-width : 90%; }" +

View File

@ -400,16 +400,20 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
if (m_combinedMode) { if (m_combinedMode) {
String content; String content;
String cssOverride = ""; String cssOverride = "";
web.setBackgroundColor(0x00000000);
if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) { if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) {
web.setBackgroundColor(android.R.color.black); cssOverride = "body { background : transparent; color : #e0e0e0}\n";
cssOverride = "body { background : black; color : #f0f0f0}\n"; } else {
cssOverride = "body { background : transparent; }\n";
} }
content = content =
"<html>" + "<html>" +
"<head>" + "<head>" +
"<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" + "<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\" />" +
"<meta name=\"viewport\" content=\"target-densitydpi=device-dpi\" />" +
"<style type=\"text/css\">" + "<style type=\"text/css\">" +
cssOverride + cssOverride +
"img { max-width : 90%; }" + "img { max-width : 90%; }" +