diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java index ff3dfbe8f..298ea7c35 100644 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java @@ -560,6 +560,9 @@ else if (options.clearSessionCache) settings.setLoadsImagesAutomatically(options.loadsImagesAutomatically); settings.setMinimumFontSize(options.minimumFontSize); settings.setMinimumLogicalFontSize(options.minimumLogicalFontSize); + if(options.initialScale != null) + setInitialScale(options.initialScale); + settings.setNeedInitialFocus(options.needInitialFocus); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) settings.setOffscreenPreRaster(options.offscreenPreRaster); @@ -963,6 +966,9 @@ else if (newOptionsMap.get("clearSessionCache") != null && newOptions.clearSessi if (newOptionsMap.get("minimumLogicalFontSize") != null && !options.minimumLogicalFontSize.equals(newOptions.minimumLogicalFontSize)) settings.setMinimumLogicalFontSize(newOptions.minimumLogicalFontSize); + if (newOptionsMap.get("initialScale") != null && !options.initialScale.equals(newOptions.initialScale)) + setInitialScale(newOptions.initialScale); + if (newOptionsMap.get("needInitialFocus") != null && options.needInitialFocus != newOptions.needInitialFocus) settings.setNeedInitialFocus(newOptions.needInitialFocus); diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewOptions.java b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewOptions.java index b06208a0d..5d547b87d 100644 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewOptions.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewOptions.java @@ -66,6 +66,7 @@ public class InAppWebViewOptions extends Options { public Boolean loadWithOverviewMode = true; public Boolean loadsImagesAutomatically = true; public Integer minimumLogicalFontSize = 8; + public Integer initialScale; public Boolean needInitialFocus = true; public Boolean offscreenPreRaster = false; public String sansSerifFontFamily = "sans-serif"; diff --git a/lib/src/webview_options.dart b/lib/src/webview_options.dart index ea78f5626..5d37b93f4 100644 --- a/lib/src/webview_options.dart +++ b/lib/src/webview_options.dart @@ -174,6 +174,7 @@ class AndroidInAppWebViewOptions implements WebViewOptions, BrowserOptions, Andr bool loadWithOverviewMode; bool loadsImagesAutomatically; int minimumLogicalFontSize; + int initialScale; bool needInitialFocus; bool offscreenPreRaster; String sansSerifFontFamily; @@ -191,7 +192,7 @@ class AndroidInAppWebViewOptions implements WebViewOptions, BrowserOptions, Andr this.disabledActionModeMenuItems, this.fantasyFontFamily = "fantasy", this.fixedFontFamily = "monospace", this.forceDark = AndroidInAppWebViewForceDark.FORCE_DARK_OFF, this.geolocationEnabled = true, this.layoutAlgorithm, this.loadWithOverviewMode = true, this.loadsImagesAutomatically = true, this.minimumLogicalFontSize = 8, this.needInitialFocus = true, this.offscreenPreRaster = false, this.sansSerifFontFamily = "sans-serif", this.serifFontFamily = "sans-serif", - this.standardFontFamily = "sans-serif", this.saveFormData = true, this.thirdPartyCookiesEnabled = true, this.hardwareAcceleration = true + this.standardFontFamily = "sans-serif", this.saveFormData = true, this.thirdPartyCookiesEnabled = true, this.hardwareAcceleration = true, this.initialScale }); @override @@ -227,6 +228,7 @@ class AndroidInAppWebViewOptions implements WebViewOptions, BrowserOptions, Andr "loadWithOverviewMode": loadWithOverviewMode, "loadsImagesAutomatically": loadsImagesAutomatically, "minimumLogicalFontSize": minimumLogicalFontSize, + "initialScale": initialScale, "needInitialFocus": needInitialFocus, "offscreenPreRaster": offscreenPreRaster, "sansSerifFontFamily": sansSerifFontFamily, @@ -271,6 +273,7 @@ class AndroidInAppWebViewOptions implements WebViewOptions, BrowserOptions, Andr options.loadWithOverviewMode = map["loadWithOverviewMode"]; options.loadsImagesAutomatically = map["loadsImagesAutomatically"]; options.minimumLogicalFontSize = map["minimumLogicalFontSize"]; + options.initialScale = map["initialScale"]; options.needInitialFocus = map["needInitialFocus"]; options.offscreenPreRaster = map["offscreenPreRaster"]; options.sansSerifFontFamily = map["sansSerifFontFamily"];