Make SDL fullscreen windows on Android actually fullscreen
authorSam Lantinga <slouken@libsdl.org>
Thu, 02 Nov 2017 10:41:55 -0700
changeset 11672cf6fe791a6ee
parent 11671 3dc400fafd76
child 11673 9c7602bf7385
Make SDL fullscreen windows on Android actually fullscreen
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
     1.1 --- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Thu Nov 02 08:48:14 2017 -0700
     1.2 +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Thu Nov 02 10:41:55 2017 -0700
     1.3 @@ -211,6 +211,20 @@
     1.4  
     1.5          setContentView(mLayout);
     1.6  
     1.7 +        /* 
     1.8 +         * Per SDL_androidwindow.c, Android will only ever have one window, and that window 
     1.9 +         * is always flagged SDL_WINDOW_FULLSCREEN.  Let's treat it as an immersive fullscreen 
    1.10 +         * window for Android UI purposes, as a result.
    1.11 +         */
    1.12 +        int iFlags = 
    1.13 +            View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
    1.14 +            View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
    1.15 +            View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
    1.16 +            View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
    1.17 +            View.SYSTEM_UI_FLAG_FULLSCREEN;
    1.18 +
    1.19 +        getWindow().getDecorView().setSystemUiVisibility(iFlags);        
    1.20 +
    1.21          // Get filename from "Open with" of another application
    1.22          Intent intent = getIntent();
    1.23          if (intent != null && intent.getData() != null) {