Improve MessageWebView display.

Now that MessageWebView has 'setUseWideViewPort(true)',
the wide view port is excessively wide.  It turns out
Android is using a fixed width of 980 px, so that even
plain text messages (which are already wrapped to fit
the screen) have a large empty area beside them when
scrolled to the left.

Injecting a meta tag in the html header fixes the
problem.
This commit is contained in:
Joe Steele 2013-03-01 12:55:51 -05:00
parent 28212bc04f
commit 731022339d
1 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,8 @@ public class HtmlConverter {
private static final int MAX_SMART_HTMLIFY_MESSAGE_LENGTH = 1024 * 256 ;
public static final String getHtmlHeader() {
return "<html><head/><body>";
// Include a meta tag so the MessageWebView will not use a fixed viewport width of 980 px
return "<html><head><meta name=\"viewport\" content=\"width=device-width\"/></head><body>";
}
public static final String getHtmlFooter() {