From d73ec0b7966ae7db423bb92af70149fbc1c6a3c9 Mon Sep 17 00:00:00 2001 From: Sebastien Blanc Date: Mon, 22 Sep 2014 14:42:04 +0200 Subject: [PATCH] add option useWidthViewPort This closes #66 --- src/android/InAppBrowser.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java index ef37fed..24a8efa 100644 --- a/src/android/InAppBrowser.java +++ b/src/android/InAppBrowser.java @@ -88,6 +88,7 @@ public class InAppBrowser extends CordovaPlugin { private static final String MEDIA_PLAYBACK_REQUIRES_USER_ACTION = "mediaPlaybackRequiresUserAction"; private static final String SHOULD_PAUSE = "shouldPauseOnSuspend"; private static final Boolean DEFAULT_HARDWARE_BACK = true; + private static final String USER_WIDE_VIEW_PORT = "useWideViewPort"; private InAppBrowserDialog dialog; private WebView inAppWebView; @@ -101,6 +102,7 @@ public class InAppBrowser extends CordovaPlugin { private boolean hadwareBackButton = true; private boolean mediaPlaybackRequiresUserGesture = false; private boolean shouldPauseInAppBrowser = false; + private boolean useWideViewPort = true; /** * Executes the request and returns PluginResult. @@ -558,6 +560,10 @@ public class InAppBrowser extends CordovaPlugin { if (shouldPause != null) { shouldPauseInAppBrowser = shouldPause.booleanValue(); } + Boolean wideViewPort = features.get(USER_WIDE_VIEW_PORT); + if (wideViewPort != null ) { + useWideViewPort = wideViewPort.booleanValue(); + } } final CordovaWebView thatWebView = this.webView; @@ -758,7 +764,7 @@ public class InAppBrowser extends CordovaPlugin { inAppWebView.loadUrl(url); inAppWebView.setId(Integer.valueOf(6)); inAppWebView.getSettings().setLoadWithOverviewMode(true); - inAppWebView.getSettings().setUseWideViewPort(true); + inAppWebView.getSettings().setUseWideViewPort(useWideViewPort); inAppWebView.requestFocus(); inAppWebView.requestFocusFromTouch();