gabriel2mm commented on code in PR #1939:
URL: https://github.com/apache/cordova-android/pull/1939#discussion_r3307974761
##########
framework/src/org/apache/cordova/SystemBarPlugin.java:
##########
@@ -129,13 +127,10 @@ private void setStatusBarBackgroundColor(JSONArray
argbVals) {
int r = argbVals.getInt(1);
int g = argbVals.getInt(2);
int b = argbVals.getInt(3);
- String hexColor = String.format("#%02X%02X%02X%02X", a, r, g, b);
- int parsedColor = parseColorFromString(hexColor);
- if (parsedColor == INVALID_COLOR) return;
+ overrideStatusBarBackgroundColor =
String.format("#%02X%02X%02X%02X", a, r, g, b);
- overrideStatusBarBackgroundColor = parsedColor;
- updateStatusBar(overrideStatusBarBackgroundColor);
+ updateSystemBars();
Review Comment:
Updated as suggested.
##########
framework/src/org/apache/cordova/SystemBarPlugin.java:
##########
@@ -145,30 +140,34 @@ private void setStatusBarBackgroundColor(JSONArray
argbVals) {
* Attempt to update all system bars (status, navigation and gesture bars)
in various points
* of the apps life cycle.
* For example:
- * 1. Device configurations between (E.g. between dark and light mode)
- * 2. User resumes the app
- * 3. App transitions from SplashScreen Theme to App's Theme
+ * 1. Device configurations between (E.g. between dark and light mode)
+ * 2. User resumes the app
+ * 3. App transitions from SplashScreen Theme to App's Theme
*/
private void updateSystemBars() {
// Update Root View Background Color
- int rootViewBackgroundColor = getPreferenceBackgroundColor();
- if (rootViewBackgroundColor == INVALID_COLOR) {
+ Integer rootViewBackgroundColor = getPreferenceBackgroundColor();
+ if (rootViewBackgroundColor == null) {
rootViewBackgroundColor = canEdgeToEdge ? Color.TRANSPARENT :
getUiModeColor();
}
updateRootView(rootViewBackgroundColor);
// Update StatusBar Background Color
- int statusBarBackgroundColor;
- if (overrideStatusBarBackgroundColor != INVALID_COLOR) {
- statusBarBackgroundColor = overrideStatusBarBackgroundColor;
+ Integer statusBarBackgroundColor;
+ if (overrideStatusBarBackgroundColor != null) {
+ statusBarBackgroundColor =
parseColorFromString(overrideStatusBarBackgroundColor);
} else if (preferences.contains("StatusBarBackgroundColor")) {
statusBarBackgroundColor = getPreferenceStatusBarBackgroundColor();
- } else if(preferences.contains("BackgroundColor")){
- statusBarBackgroundColor = rootViewBackgroundColor;
+ } else if (preferences.contains("BackgroundColor")) {
+ statusBarBackgroundColor = rootViewBackgroundColor;
} else {
statusBarBackgroundColor = canEdgeToEdge ? Color.TRANSPARENT :
getUiModeColor();
}
+ if (statusBarBackgroundColor == null) {
+ statusBarBackgroundColor = canEdgeToEdge ? Color.TRANSPARENT :
getUiModeColor();
+ }
+
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]