Hi, when I tested a build of my game on my friend’s Xiaomi Mi 2 Lite with cutout I noticed a very strange behavior that I was able to reproduce on emulator too. With default settings - so without changing Window.Attributes.LayoutInDisplayCutoutMode
attribute that’s what I got (screen taken straight from device):
I see two issues:
-
Everything is moved to the right. Sure, that’s because there’s a cutout on the left side. I guess the issue is that I can’t get proper width that would take into account the size of the cutout. I get the screen resolution using
GetRealMetrics()
method fromDisplayMetrics
class. -
Whole screen is shifted down. I have no idea why this happens - again, on phones without cutout this doesn’t occur. My UI settings are:
var uiOptions =
SystemUiFlags.HideNavigation |
SystemUiFlags.Fullscreen |
SystemUiFlags.ImmersiveSticky |
SystemUiFlags.LowProfile;
Window.DecorView.SystemUiVisibility = (StatusBarVisibility)uiOptions;
Window.AddFlags(WindowManagerFlags.TranslucentStatus);
After some testing I think that’s status bar, but it is set to translucent here.
Do you have any idea how to fix this behavior?