private void showHtml(final List<HtmlEntry> htmlEntries, final String htmlTextToHighlight) {
String html = HtmlEntry.htmlBody(htmlEntries, index.shortName);
+ String style = "";
+ if (typeface == Typeface.SERIF) { style = "font-family: serif;"; }
+ else if (typeface == Typeface.SANS_SERIF) { style = "font-family: sans-serif;"; }
+ else if (typeface == Typeface.MONOSPACE) { style = "font-family: monospace;"; }
+ if (application.getSelectedTheme() == DictionaryApplication.Theme.DEFAULT)
+ style += "background-color: black; color: white;";
// Log.d(LOG, "html=" + html);
startActivityForResult(
HtmlDisplayActivity.getHtmlIntent(getApplicationContext(), String.format(
- "<html><head><meta name=\"viewport\" content=\"width=device-width\"></head><body>%s</body></html>", html),
+ "<html><head><meta name=\"viewport\" content=\"width=device-width\"></head><body style=\"%s\">%s</body></html>", style, html),
htmlTextToHighlight, false),
0);
}
super(context, attrs);
getSettings().setSupportZoom(true);
getSettings().setBuiltInZoomControls(true);
+ // TODO: check why AUTO does not work and consider using it (API 29/Android 10 only)
+ //getSettings().setForceDark(WebSettings.FORCE_DARK_ON);
final WebViewClient webViewClient = new WebViewClient() {
@Override