Don't overwrite the whole SystemUiVisibility in setStatusBarTransparent

Fixes #275
This commit is contained in:
Mohammad Rafigh 2024-10-28 21:39:14 +03:30 committed by GitHub
parent 5492147ab7
commit 66cc74f1bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -185,9 +185,10 @@ public class StatusBar extends CordovaPlugin {
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);