Commit 944caa9d authored by YouCii's avatar YouCii

1. Enable setTextZoom function of Android-WebViewSetting

parent f3f0876f
...@@ -181,12 +181,7 @@ public class InAppWebView extends WebView { ...@@ -181,12 +181,7 @@ public class InAppWebView extends WebView {
settings.setUseWideViewPort(options.useWideViewPort); settings.setUseWideViewPort(options.useWideViewPort);
settings.setSupportZoom(options.supportZoom); settings.setSupportZoom(options.supportZoom);
// fix webview scaling settings.setTextZoom(options.textZoom);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING);
else
settings.setTextZoom(100);
} }
public void loadUrl(String url, MethodChannel.Result result) { public void loadUrl(String url, MethodChannel.Result result) {
...@@ -337,6 +332,9 @@ public class InAppWebView extends WebView { ...@@ -337,6 +332,9 @@ public class InAppWebView extends WebView {
if (newOptionsMap.get("supportZoom") != null && options.supportZoom != newOptions.supportZoom) if (newOptionsMap.get("supportZoom") != null && options.supportZoom != newOptions.supportZoom)
settings.setSupportZoom(newOptions.supportZoom); settings.setSupportZoom(newOptions.supportZoom);
if (newOptionsMap.get("textZoom") != null && options.textZoom != newOptions.textZoom)
settings.setTextZoom(newOptions.textZoom);
options = newOptions; options = newOptions;
} }
......
...@@ -21,4 +21,6 @@ public class InAppWebViewOptions extends Options { ...@@ -21,4 +21,6 @@ public class InAppWebViewOptions extends Options {
public boolean domStorageEnabled = false; public boolean domStorageEnabled = false;
public boolean useWideViewPort = true; public boolean useWideViewPort = true;
public boolean safeBrowsingEnabled = true; public boolean safeBrowsingEnabled = true;
public int textZoom = 100;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment