ClassiCube
ClassiCube copied to clipboard
Display cutout support
On Android devices with screen cutout (like camera punch-hole) the game does not render in the cutout area. I tried to solve this problem myself, but I am not a kickass android developer, so I couldn't. I tried to set window attribute LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES but the screen bounds didn't change from 2309x1080 to 2400x1080. Apparently I'm doing something wrong, but I don't know what.

This also goes for the launcher screen. and the device im using also has a camera punchhole

Are you enabling it programmatically or via modifying AndroidManifest.xml?
Are you enabling it programmatically or via modifying AndroidManifest.xml?
Tried both. As described here.
Finally I got it. Thank goodness StackOverflow exists, lol. Here is the fixed unsigned apk.
@igor725
Unfortunately turns out that window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); also causes the onscreen keyboard to stop resizing the game view on modern android devices.
e.g. when opening in-game chat on my Android 9 device, the onscreen keyboard draws over top of chat input now
I've tried some other flags, but was unsuccessful in getting both rendering over display cutout and onscreen keyboard resizing to work.
The issue seems to be that flags that enable rendering over display cutout also mark the window as fullscreen. Unfortunately, the documentation for LayoutParams.SOFT_INPUT_ADJUST_RESIZE explicitly states that it has no effect with fullscreen windows
I've decided to revert rendering over display cutout support for now
Ummm... I think we can calculate the soft keyboard height somehow then move the input box to top of it.