Edit* => I have removed these two lines -
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
and used "react-native-immersive" to hide statusbar & navigation bar. (i.e. immersive mode)
Link to react-native-immersive - npmjs.com/package/react-native-imm...
Thanks a lot for this <3
android/app/src/main/java/{...}/MainActivity.java
MainActivity.java =>
Edit* => I have removed these two lines -
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
// getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
and used "react-native-immersive" to hide statusbar & navigation bar. (i.e. immersive mode)
Link to react-native-immersive - npmjs.com/package/react-native-imm...
/* MainActivity Code below */
package com.testapp;
import com.facebook.react.ReactActivity;
import android.view.WindowManager;
import android.os.Build;
import android.os.Bundle;
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
layoutParams.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
getWindow().setAttributes(layoutParams);
}
super.onCreate(savedInstanceState);
}
@Override
protected String getMainComponentName() {
return "testapp";
}
}