In my activity I use the following code to turn on / off fullscreen. And by fullscreen I mean hiding / showing the status bar. The problem takes place on devices that has a Cutout (Where there's a camera) and the Status bar is visible and in Landscape. It extends when status bar is hidden or / and in portrait.
if(aStatus){ // Hide
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN , WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
As in this picture, on the left the white area should be covered.
https://i.stack.imgur.com/7va88.png
compileSdkVersion 29
buildToolsVersion '29.0.3'
minSdkVersion 21
targetSdkVersion 29
There'll be a 50 Points reward for selected solution. Thank you!
Here is the fix. Tweak as necessary.
Example:
Another Example:
Both tested in Activity.onCreate.