gabriel2mm commented on code in PR #1939:
URL: https://github.com/apache/cordova-android/pull/1939#discussion_r3310832836


##########
framework/src/org/apache/cordova/SystemBarPlugin.java:
##########
@@ -262,33 +257,33 @@ private static boolean isColorLight(int color) {
 
     /**
      * Returns the StatusBarBackgroundColor preference value.
-     * If the value is missing or fails to parse, it will attempt to try to 
guess the background
-     * color by extracting from the apps R.color.cdv_background_color or 
determine from the uiModes.
-     * If all fails, the color normally used in light mode is returned.
+     * If the value is missing or fails to parse, null is returned.

Review Comment:
   Updated as suggested.



##########
framework/src/org/apache/cordova/SystemBarPlugin.java:
##########
@@ -262,33 +257,33 @@ private static boolean isColorLight(int color) {
 
     /**
      * Returns the StatusBarBackgroundColor preference value.
-     * If the value is missing or fails to parse, it will attempt to try to 
guess the background
-     * color by extracting from the apps R.color.cdv_background_color or 
determine from the uiModes.
-     * If all fails, the color normally used in light mode is returned.
+     * If the value is missing or fails to parse, null is returned.
      *
-     * @return int
+     * @return Integer|null
      */
-    private int getPreferenceStatusBarBackgroundColor() {
+    private Integer getPreferenceStatusBarBackgroundColor() {
         String colorString = preferences.getString("StatusBarBackgroundColor", 
null);
 
-        int parsedColor = parseColorFromString(colorString);
-        if (parsedColor != INVALID_COLOR) return parsedColor;
-
-        return getUiModeColor(); // fallback
+        Integer parsedColor = parseColorFromString(colorString);
+        return parsedColor != null ? parsedColor : 
getUiModeColor();//getUiModeColor is used as a fallback.

Review Comment:
   Updated as suggested.



-- 
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