cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [1/7] git commit: CB-6314 - Add StatusBar.isVisible support to Android
Date Wed, 23 Apr 2014 18:57:55 GMT
Repository: cordova-plugin-statusbar
Updated Branches:
  refs/heads/master bdbaf1295 -> 50febd81b


CB-6314 - Add StatusBar.isVisible support to Android


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/commit/a6a4cf47
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/tree/a6a4cf47
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/diff/a6a4cf47

Branch: refs/heads/master
Commit: a6a4cf473b21056116f8a97e3cad583a57eafdf6
Parents: bdbaf12
Author: Andrey Kurdyumov <kant2002@gmail.com>
Authored: Wed Mar 19 16:48:59 2014 +0600
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Wed Mar 19 18:18:56 2014 -0700

----------------------------------------------------------------------
 README.md                  |  2 +-
 src/android/StatusBar.java |  5 +++++
 www/statusbar.js           | 10 +++++-----
 3 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/a6a4cf47/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 5c05a38..30c16ac 100644
--- a/README.md
+++ b/README.md
@@ -208,7 +208,7 @@ Supported Platforms
 -------------------
 
 - iOS
-
+- Android
 
 
     
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/a6a4cf47/src/android/StatusBar.java
----------------------------------------------------------------------
diff --git a/src/android/StatusBar.java b/src/android/StatusBar.java
index 24b018f..e3182a1 100644
--- a/src/android/StatusBar.java
+++ b/src/android/StatusBar.java
@@ -65,6 +65,11 @@ public class StatusBar extends CordovaPlugin {
         Log.v(TAG, "Executing action: " + action);
         final Activity activity = this.cordova.getActivity();
         final Window window = activity.getWindow();
+        if ("_ready".equals(action)) {
+            boolean statusBarVisible = (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN)
== 0;
+            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, statusBarVisible));
+        }
+
         if ("show".equals(action)) {
             this.cordova.getActivity().runOnUiThread(new Runnable() {
                 @Override

http://git-wip-us.apache.org/repos/asf/cordova-plugin-statusbar/blob/a6a4cf47/www/statusbar.js
----------------------------------------------------------------------
diff --git a/www/statusbar.js b/www/statusbar.js
index 6f4e879..53e89fd 100644
--- a/www/statusbar.js
+++ b/www/statusbar.js
@@ -38,11 +38,6 @@ var namedColors = {
     "brown": "#A52A2A"
 };
 
-// prime it
-exec(function (res) {
-    StatusBar.isVisible = res;
-}, null, "StatusBar", "_ready", []);
-
 var StatusBar = {
 
     isVisible: true,
@@ -100,4 +95,9 @@ var StatusBar = {
 
 };
 
+// prime it
+exec(function (res) {
+    StatusBar.isVisible = res;
+}, null, "StatusBar", "_ready", []);
+
 module.exports = StatusBar;


Mime
View raw message