• 2D
  • How can I make the window take account of Android's status bar?

I'm developing an app for android. I want the window's size to fill all available screen space, minus the status bar at the top of the phone. Any clues about how I could do this?

I want this:

Not this:

If you disable Fullscreen (or "Immersive Mode") in the Android export preset, the status bar and bottom action bar should appear when running the project (after exporting it again).

Since Godot 3.3, you can also use OS.get_window_safe_area() to get the size of the screen not covered by the notch.

@Calinou said: If you disable Fullscreen (or "Immersive Mode") in the Android export preset, the status bar and bottom action bar should appear when running the project (after exporting it again).

That didn't work for me. Disabling fullscreen/immersive got me the buttons at the bottom of the screen, but not the top status bar.

Instead, I had to install the android build template (project menu), select "custom build" in the export, and edit the following file:

android/build/res/values/themes.xml

Removing the ".Fullscreen" from the style/parent, so that it reads:

<style name="GodotAppMainTheme" parent="@android:style/Theme.Black.NoTitleBar"/>

Now, when I export to my android 11 phone, I can see both top and bottom bars.