Skip to content

Commit bfa1941

Browse files
committed
fix: setting appearance when e2e is enabled
1 parent d903cfa commit bfa1941

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

framework/src/org/apache/cordova/SystemBarPlugin.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@ private void updateRootView(int bgColor) {
194194
if (root != null) root.setBackgroundColor(bgColor);
195195

196196
// Automatically set the font and icon color of the system bars based on background color.
197-
boolean isBackgroundColorLight = isColorLight(bgColor);
197+
boolean isBackgroundColorLight;
198+
if(bgColor == Color.TRANSPARENT) {
199+
isBackgroundColorLight = isColorLight(getUiModeColor());
200+
} else {
201+
isBackgroundColorLight = isColorLight(bgColor);
202+
}
198203
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
199204
WindowInsetsController controller = window.getInsetsController();
200205
if (controller != null) {
@@ -232,7 +237,12 @@ private void updateStatusBar(int bgColor) {
232237
}
233238

234239
// Automatically set the font and icon color of the system bars based on background color.
235-
boolean isStatusBarBackgroundColorLight = isColorLight(bgColor);
240+
boolean isStatusBarBackgroundColorLight;
241+
if(bgColor == Color.TRANSPARENT) {
242+
isStatusBarBackgroundColorLight = isColorLight(getUiModeColor());
243+
} else {
244+
isStatusBarBackgroundColorLight = isColorLight(bgColor);
245+
}
236246
WindowInsetsControllerCompat controllerCompat = WindowCompat.getInsetsController(window, window.getDecorView());
237247
controllerCompat.setAppearanceLightStatusBars(isStatusBarBackgroundColorLight);
238248
}

0 commit comments

Comments
 (0)