Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion framework/src/org/apache/cordova/SystemBarPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ public class SystemBarPlugin extends CordovaPlugin {
private int overrideStatusBarBackgroundColor = INVALID_COLOR;

private boolean canEdgeToEdge = false;
private String edgeToEdgeGlyphTheme = null;

@Override
protected void pluginInitialize() {
context = cordova.getContext();
resources = context.getResources();
canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false)
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM;
edgeToEdgeGlyphTheme = preferences.getString("EdgeToEdgeGlyphTheme", null);
}

@Override
Expand Down Expand Up @@ -238,7 +240,10 @@ private void updateStatusBar(int bgColor) {

// Automatically set the font and icon color of the system bars based on background color.
boolean isStatusBarBackgroundColorLight;
if(bgColor == Color.TRANSPARENT) {
if (canEdgeToEdge && edgeToEdgeGlyphTheme != null
&& edgeToEdgeGlyphTheme.matches("(?i)(dark|light)")) {
isStatusBarBackgroundColorLight = edgeToEdgeGlyphTheme.equalsIgnoreCase("dark");
} else if(bgColor == Color.TRANSPARENT) {
isStatusBarBackgroundColorLight = isColorLight(getUiModeColor());
} else {
isStatusBarBackgroundColorLight = isColorLight(bgColor);
Expand Down
Loading