My app is immersive and full screen, but in new devices running android 9 + with front camera hole on screen - there is a black line instead of the status bar. (the status bar used to be where the camera hole is). I want to get all of the screen full, include the camera hole area.
I know the user can go to : setting, display, full screen apps - and in this option find my app and change it from "auto" to "full screen" (in android 9) or from OFF to ON (in android 11) and than it will be stretched also over the camera hole. but I must do it programmatically from inside the app.
I can see many games and apps on the phone that are in a total full screen also over the camera hole, even if in setting: display: full screen apps -> the "full screen" option is switched OFF (android 11) or "Auto" (android 9) for these apps. So it must be possible to do it programmatically.
Now I am using this in order to go full screen (same as in android studio simple fullScreenActivity new project):
private final Runnable mHidePart2Runnable = new Runnable() {
@SuppressLint("InlinedApi")
@Override
public void run() {
// Delayed removal of status and navigation bar
// Note that some of these constants are new as of API 16 (Jelly Bean)
// and API 19 (KitKat). It is safe to use them, as they are inlined
// at compile-time and do nothing on earlier devices.
mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
}
};
Thanks for answering
In the pictures:
Full screen activity when device`s full screen display settings for this app is : "Auto" so there is a black line instead of the status bar (on the front camera area). how can I make the full screen stretch also on this place?
Full screen activity where android display settings for this app is "Full screen".
The settings change options(I want to change from "Auto" to "Full screen" programmatically).