You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by no...@apache.org on 2020/04/12 00:12:58 UTC

[cordova-plugin-statusbar] branch master updated: BREAKING CHANGE!: (android) Read config.xml for statusbar overlay preference (#171)

This is an automated email from the ASF dual-hosted git repository.

normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-statusbar.git


The following commit(s) were added to refs/heads/master by this push:
     new 5332e3b  BREAKING CHANGE!: (android) Read config.xml for statusbar overlay preference (#171)
5332e3b is described below

commit 5332e3b667db28e71eb2cecda3d1a6b72723a880
Author: Norman Breau <no...@normanbreau.com>
AuthorDate: Sat Apr 11 21:12:47 2020 -0300

    BREAKING CHANGE!: (android) Read config.xml for statusbar overlay preference (#171)
    
    * (android) Read config.xml for statusbar overlay preference
    
    * Added information on the ability to use #AARRGGBB hex string format if StatusBarOverlaysWebView is true
    
    * Added `<preference name="StatusBarOverlaysWebView" value="true" />` to the default android block for consistentency for iOS.
---
 README.md                  | 2 +-
 plugin.xml                 | 1 +
 src/android/StatusBar.java | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 1d0ce9c..cf02d4a 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ Preferences
     
     Only supported on Android 5 or later. Earlier versions will ignore this preference.
 
-- __StatusBarBackgroundColor__ (color hex string, no default value). Set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color will be transparent.
+- __StatusBarBackgroundColor__ (color hex string, no default value). Set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color will be transparent. If `StatusBarOverlaysWebView` is set to true, then a 8 digit hex (#AARRGGBB) string can optionally be used to define the transparency.
 
         <preference name="StatusBarBackgroundColor" value="#000000" />
 
diff --git a/plugin.xml b/plugin.xml
index c5ccadc..fce1238 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -43,6 +43,7 @@
                 <param name="android-package" value="org.apache.cordova.statusbar.StatusBar" />
                 <param name="onload" value="true" />
             </feature>
+            <preference name="StatusBarOverlaysWebView" value="true" />
         </config-file>
     </platform>
 
diff --git a/src/android/StatusBar.java b/src/android/StatusBar.java
index 5159ada..2d28960 100644
--- a/src/android/StatusBar.java
+++ b/src/android/StatusBar.java
@@ -59,6 +59,9 @@ public class StatusBar extends CordovaPlugin {
                 Window window = cordova.getActivity().getWindow();
                 window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
 
+                // Read 'StatusBarOverlaysWebView' from config.xml, default is true.
+                setStatusBarTransparent(preferences.getBoolean("StatusBarOverlaysWebView", true));
+
                 // Read 'StatusBarBackgroundColor' from config.xml, default is #000000.
                 setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000"));
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org