(android) Added option to turn on/off fullscreen mode in Android (#634)
* (android) Added option to turn on/off fullscreen mode in Android * (android) Reverted version changes as requested * (android) Changing default option value to enabled as per request Co-authored-by: Alessandro Basso <Alessandro.Basso@PeapodDigitalLabs.com>
This commit is contained in:
@@ -117,6 +117,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
private static final String FOOTER = "footer";
|
||||
private static final String FOOTER_COLOR = "footercolor";
|
||||
private static final String BEFORELOAD = "beforeload";
|
||||
private static final String FULLSCREEN = "fullscreen";
|
||||
|
||||
private static final List customizableOptions = Arrays.asList(CLOSE_BUTTON_CAPTION, TOOLBAR_COLOR, NAVIGATION_COLOR, CLOSE_BUTTON_COLOR, FOOTER_COLOR);
|
||||
|
||||
@@ -147,6 +148,7 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
private boolean showFooter = false;
|
||||
private String footerColor = "";
|
||||
private String beforeload = "";
|
||||
private boolean fullscreen = true;
|
||||
private String[] allowedSchemes;
|
||||
private InAppBrowserClient currentClient;
|
||||
|
||||
@@ -714,6 +716,10 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
if (features.get(BEFORELOAD) != null) {
|
||||
beforeload = features.get(BEFORELOAD);
|
||||
}
|
||||
String fullscreenSet = features.get(FULLSCREEN);
|
||||
if (fullscreenSet != null) {
|
||||
fullscreen = fullscreenSet.equals("yes") ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
final CordovaWebView thatWebView = this.webView;
|
||||
@@ -794,7 +800,9 @@ public class InAppBrowser extends CordovaPlugin {
|
||||
dialog = new InAppBrowserDialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar);
|
||||
dialog.getWindow().getAttributes().windowAnimations = android.R.style.Animation_Dialog;
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
if (fullscreen) {
|
||||
dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
dialog.setCancelable(true);
|
||||
dialog.setInAppBroswer(getInAppBrowser());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user