SDL Android fullscreen code extensively tested on Steam Link with no issues reported
authorSam Lantinga <slouken@libsdl.org>
Wed, 13 Jun 2018 14:24:30 -0700
changeset 1201925d299fc8443
parent 12018 812b05d074fe
child 12020 7f3c9bffada4
SDL Android fullscreen code extensively tested on Steam Link with no issues reported
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	Wed Jun 13 14:45:02 2018 +0300
     1.2 +++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java	Wed Jun 13 14:24:30 2018 -0700
     1.3 @@ -480,18 +480,16 @@
     1.4                      // This version of Android doesn't support the immersive fullscreen mode
     1.5                      break;
     1.6                  }
     1.7 -/* This needs more testing, per bug 4096 - Enabling fullscreen on Android causes the app to toggle fullscreen mode continuously in a loop
     1.8 - ***
     1.9                  if (context instanceof Activity) {
    1.10                      Window window = ((Activity) context).getWindow();
    1.11                      if (window != null) {
    1.12                          if ((msg.obj instanceof Integer) && (((Integer) msg.obj).intValue() != 0)) {
    1.13 -                            int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
    1.14 +                            int flags = View.SYSTEM_UI_FLAG_FULLSCREEN |
    1.15 +                                        View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
    1.16 +                                        View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
    1.17 +                                        View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
    1.18                                          View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
    1.19 -                                        View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
    1.20 -                                        View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
    1.21 -                                        View.SYSTEM_UI_FLAG_FULLSCREEN |
    1.22 -                                        View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    1.23 +					View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
    1.24                              window.getDecorView().setSystemUiVisibility(flags);        
    1.25                              window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    1.26                          } else {
    1.27 @@ -503,7 +501,6 @@
    1.28                  } else {
    1.29                      Log.e(TAG, "error handling message, getContext() returned no Activity");
    1.30                  }
    1.31 -***/
    1.32                  break;
    1.33              case COMMAND_TEXTEDIT_HIDE:
    1.34                  if (mTextEdit != null) {