Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ function capacitorSystemBarsCheckMetaViewport() {
private boolean insetHandlingEnabled = true;
private boolean hasViewportCover = false;

private String currentStyle = STYLE_DEFAULT;
private String currentStatusBarStyle = STYLE_DEFAULT;
private String currentGestureBarStyle = STYLE_DEFAULT;

@Override
public void load() {
Expand Down Expand Up @@ -85,7 +86,8 @@ public void onPageCommitVisible(WebView view, String url) {
protected void handleOnConfigurationChanged(Configuration newConfig) {
super.handleOnConfigurationChanged(newConfig);

setStyle(currentStyle, "");
setStyle(currentGestureBarStyle, BAR_GESTURE_BAR);
setStyle(currentStatusBarStyle, BAR_STATUS_BAR);
}

private void initSystemBars() {
Expand Down Expand Up @@ -259,19 +261,19 @@ private void injectSafeAreaCSS(int top, int right, int bottom, int left) {
}

private void setStyle(String style, String bar) {
currentStyle = style;

if (style.equals(STYLE_DEFAULT)) {
style = getStyleForTheme();
}

Window window = getActivity().getWindow();
WindowInsetsControllerCompat windowInsetsControllerCompat = WindowCompat.getInsetsController(window, window.getDecorView());
if (bar.isEmpty() || bar.equals(BAR_STATUS_BAR)) {
currentStatusBarStyle = style;
windowInsetsControllerCompat.setAppearanceLightStatusBars(!style.equals(STYLE_DARK));
}

if (bar.isEmpty() || bar.equals(BAR_GESTURE_BAR)) {
currentGestureBarStyle = style;
windowInsetsControllerCompat.setAppearanceLightNavigationBars(!style.equals(STYLE_DARK));
}

Expand Down
Loading