When setting statusBar: { drawBehind: true } as default option, it is not respected on Android. Only when setting it via static options () it is being applied.
Navigation.setDefaultOptions({
statusBar: {
style: 'light',
backgroundColor: '#ff6600',
drawBehind: true,
},
})
Issue also present when used with mergeOptions i.e. drawBehind is not respected. no relayout happens when drawBehind is set again to false.
My use case is a video player where I use mergeOptions to change statusBar config on fullscreen and vice versa.
Here is the usage:
onEnterFullScreen = () => {
StatusBar.setHidden(true, true);
Utils.updateScreenOptions({
statusBar: {
visible: false,
drawBehind: true,
},
});
this.setState({
videoFullScreen: true,
currentOrientation: this.state.preferredVideoOrientation
});
this.props.onEnterFullScreen && this.props.onEnterFullScreen();
};
onExitFullScreen = () => {
StatusBar.setHidden(false, true);
Utils.updateScreenOptions({
statusBar: {
visible: true,
drawBehind: false,
},
});
this.setState({
videoFullScreen: false,
currentOrientation: 'portrait'
});
this.props.onExitFullScreen && this.props.onExitFullScreen();
};
SYSTEM_UI_FLAG_LAYOUT_STABLE seems to be already set, when I checked Presenter.java -> mergeStatusBarVisible method.
I would like my content to re-layout when statusbar is visible again and not draw behind the status bar when exited from fullscreen.
Multiple guides are here with android doc:
https://developer.android.com/training/system-ui/navigation
https://developer.android.com/training/system-ui/status#behind
+1
same issue
@guyca is this hard to solve? I'm trying to solve this issue, but after change the code i have to wait 30s of build time.
+1
I have the same issue.
@guyca Thank you! I'll investigate.
Hey guys any ETA on this one? Unfortunately I can not use static options() as I'm on ES5 (hints how to get it working on ES5 are appreciated).
@serjek unfortunately i don't know a ETA. I tried to fix this, but i didn't.
Most helpful comment
@guyca Thank you! I'll investigate.