react-native-unity-view icon indicating copy to clipboard operation
react-native-unity-view copied to clipboard

Disable immersive mode on Android

Open im-aditya opened this issue 7 years ago • 6 comments

After adding the Unity plugin my Android app has switched to immersive mode. I guess this is the default setting by Unity.

Is there anyway I can override this setting ? I dont want my app to be in immersive mode.

Thanks

im-aditya avatar Aug 14 '18 15:08 im-aditya

Add StatusBar to root component.

<StatusBar translucent={true} backgroundColor='rgba(0,0,0,0)' barStyle='dark-content'/>

f111fei avatar Aug 15 '18 06:08 f111fei

This is not working. It shows status bar but the bottom navigation bar is still hidden and the app is covering fullscreen of the device. The content is going under the status bar.

I have also added this

if (Platform.OS === 'android') {
    StatusBar.setHidden(false);
    StatusBar.setBackgroundColor('#ffffff');
    StatusBar.setBarStyle('dark-content');
}

im-aditya avatar Aug 15 '18 07:08 im-aditya

I'm seeing this behavior as well. Is there any way to disable this on the unity side while building your Android artifacts before it even gets to react-native? Thanks.

jasonmerino avatar Sep 19 '18 15:09 jasonmerino

I tried setting

Screen.fullScreen = false;

on the Unity side and it is working for me.

im-aditya avatar Sep 19 '18 19:09 im-aditya

@im-aditya thanks for the input. I tried to do that, and while it works after a second there is some time before that when the app goes into full screen. Any idea on how to completely stop this from happening?

jasonmerino avatar Sep 20 '18 17:09 jasonmerino

https://feedback.unity3d.com/suggestions/add-a-setting-to-disable-android-immersive-mode-before-splash-screen

Looks like 2018.3 is adding this feature...

mtostenson avatar Sep 20 '18 20:09 mtostenson