From bb8c3a9cc27da8949040bb9ea2267ceb00e13e2d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 2 Nov 2017 10:41:55 -0700 Subject: [PATCH] Make SDL fullscreen windows on Android actually fullscreen --- .../src/main/java/org/libsdl/app/SDLActivity.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 75e18bb2c..c5520f81b 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -211,6 +211,20 @@ public class SDLActivity extends Activity { setContentView(mLayout); + /* + * Per SDL_androidwindow.c, Android will only ever have one window, and that window + * is always flagged SDL_WINDOW_FULLSCREEN. Let's treat it as an immersive fullscreen + * window for Android UI purposes, as a result. + */ + int iFlags = + View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | + View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | + View.SYSTEM_UI_FLAG_FULLSCREEN; + + getWindow().getDecorView().setSystemUiVisibility(iFlags); + // Get filename from "Open with" of another application Intent intent = getIntent(); if (intent != null && intent.getData() != null) {