dpogue commented on code in PR #1955:
URL: https://github.com/apache/cordova-android/pull/1955#discussion_r3397621521


##########
framework/src/org/apache/cordova/SystemBarPlugin.java:
##########
@@ -121,19 +121,17 @@ private void setStatusBarVisible(final boolean visible) {
      * If the supplied ARGB is invalid or fails to parse, it will silently 
ignore
      * the change request.
      *
-     * @param argbVals {A, R, G, B}
+     * @param argbVals {R, G, B, A}
      */
     private void setStatusBarBackgroundColor(JSONArray argbVals) {
         try {
-            int a = argbVals.getInt(0);
-            int r = argbVals.getInt(1);
-            int g = argbVals.getInt(2);
-            int b = argbVals.getInt(3);
-            overrideStatusBarBackgroundColor = 
parseColorFromString(String.format("#%02X%02X%02X%02X", a, r, g, b));
-
-            if (overrideStatusBarBackgroundColor != null) {
-                updateStatusBar(overrideStatusBarBackgroundColor);
-            }
+            float r = argbVals.getInt(0) / 255.f;
+            float g = argbVals.getInt(1) / 255.f;
+            float b = argbVals.getInt(2) / 255.f;
+            float a = (float)argbVals.optDouble(3, 1.0);
+
+            overrideStatusBarBackgroundColor = Color.valueOf(r, g, b, 
a).toArgb();

Review Comment:
   oh, good catch!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to