From 66cc74f1bcd33f1f02276ed0e496379a4c95adcc Mon Sep 17 00:00:00 2001 From: Mohammad Rafigh Date: Mon, 28 Oct 2024 21:39:14 +0330 Subject: [PATCH] Don't overwrite the whole SystemUiVisibility in setStatusBarTransparent Fixes #275 --- src/android/StatusBar.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/android/StatusBar.java b/src/android/StatusBar.java index b350fa4f..ea151190 100644 --- a/src/android/StatusBar.java +++ b/src/android/StatusBar.java @@ -185,9 +185,10 @@ private void setStatusBarBackgroundColor(final String colorPref) { private void setStatusBarTransparent(final boolean isTransparent) { final Window window = cordova.getActivity().getWindow(); + int uiOptions = window.getDecorView().getSystemUiVisibility(); int visibility = isTransparent - ? View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - : View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE; + ? uiOptions | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + : uiOptions | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE; window.getDecorView().setSystemUiVisibility(visibility);