mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-18 21:28:54 +00:00
Use browser's default font
This commit is contained in:
parent
030edd63de
commit
efef382c51
2 changed files with 2 additions and 15 deletions
|
@ -1984,9 +1984,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
|
|
||||||
webView.setMinimumHeight(height);
|
webView.setMinimumHeight(height);
|
||||||
|
|
||||||
webView.init(
|
webView.init(height, size, position,
|
||||||
height, size, position,
|
|
||||||
textSize, monospaced,
|
|
||||||
new WebViewEx.IWebView() {
|
new WebViewEx.IWebView() {
|
||||||
@Override
|
@Override
|
||||||
public void onSizeChanged(int w, int h, int ow, int oh) {
|
public void onSizeChanged(int w, int h, int ow, int oh) {
|
||||||
|
|
|
@ -69,10 +69,7 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
||||||
settings.setSafeBrowsingEnabled(safe_browsing);
|
settings.setSafeBrowsingEnabled(safe_browsing);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(
|
void init(int height, float size, Pair<Integer, Integer> position, IWebView intf) {
|
||||||
int height, float size, Pair<Integer, Integer> position,
|
|
||||||
float textSize, boolean monospaced,
|
|
||||||
IWebView intf) {
|
|
||||||
Log.i("Init height=" + height + " size=" + size);
|
Log.i("Init height=" + height + " size=" + size);
|
||||||
|
|
||||||
this.height = (height == 0 ? getMinimumHeight() : height);
|
this.height = (height == 0 ? getMinimumHeight() : height);
|
||||||
|
@ -84,14 +81,6 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
||||||
setScrollY(position.second);
|
setScrollY(position.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebSettings settings = getSettings();
|
|
||||||
if (textSize != 0) {
|
|
||||||
settings.setDefaultFontSize(Math.round(textSize));
|
|
||||||
settings.setDefaultFixedFontSize(Math.round(textSize));
|
|
||||||
}
|
|
||||||
if (monospaced)
|
|
||||||
settings.setStandardFontFamily("monospace");
|
|
||||||
|
|
||||||
this.intf = intf;
|
this.intf = intf;
|
||||||
|
|
||||||
setWebViewClient(new WebViewClient() {
|
setWebViewClient(new WebViewClient() {
|
||||||
|
|
Loading…
Reference in a new issue