Dynamically generate the CSS style for <pre> elements
for inclusion in the HTML <head> element when messages
are displayed.
This permits a user to change their font-family preference
for plain text messages and see the results immediately.
Obviously any old locally-stored messages that had their
font-family stored with them will continue to display using
that font-family, irrespective of the user's current
preference setting.
The MIME type for the supplied text was always text/html,
so there is no need to pass that as a parameter.
Furthermore, we are relying on it being text/html because
we are wrapping it with HTML code.
Likewise, change/simplify/rename AccessibleWebView.loadDataWithBaseURL().
Previously, <html>, <head>, & <body> tags were
attached to messages before they were stored locally.
But now that the <head> element also needs to include
a <meta> element (for proper MessageWebView display),
it seems unecesary to store all these tags with each
message.
Now the tags are no longer stored with the messages. Instead,
MessageWebView applies the tags before displaying the message.
This also eliminates the need to upgrade an older
message database where all the old messages would have
otherwise needed to be wrapped with the new tags.
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.
Database updates can be surprisingly slow. This lead to slow updates of
the user interface which in turn made working with K-9 Mail not as fun
as it should be. This commit hopefully changes that.
This happened for example in a starred-message-only view when
un-starting the last message. This led to isFirst() and isLast()
causing a NullPointerException when trying to update the
previous / next buttons.