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 cssOverride = "";
web.setBackgroundColor(0x00000000);
if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) {
web.setBackgroundColor(android.R.color.black);
cssOverride = "body { background : black; color : #f0f0f0}\n";
cssOverride = "body { background : transparent; color : #e0e0e0}\n";
} else {
cssOverride = "body { background : transparent; }\n";
}
content =
"<html>" +
"<head>" +
"<meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\">" +
"<meta name=\"viewport\" content=\"target-densitydpi=device-dpi\" />" +
"<style type=\"text/css\">" +
cssOverride +
"img { max-width : 90%; }" +

View File

@ -400,16 +400,20 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
if (m_combinedMode) {
String content;
String cssOverride = "";
web.setBackgroundColor(0x00000000);
if (m_prefs.getString("theme", "THEME_DARK").equals("THEME_DARK")) {
web.setBackgroundColor(android.R.color.black);
cssOverride = "body { background : black; color : #f0f0f0}\n";
cssOverride = "body { background : transparent; color : #e0e0e0}\n";
} else {
cssOverride = "body { background : transparent; }\n";
}
content =
"<html>" +
"<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\">" +
cssOverride +
"img { max-width : 90%; }" +