diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidLauncher.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidLauncher.java index 12564c8b0..9feaa1809 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidLauncher.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidLauncher.java @@ -40,6 +40,8 @@ public class AndroidLauncher extends AndroidApplication { public static AndroidApplication instance; protected static GLSurfaceView view; + private AndroidPlatformSupport support; + @Override protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -68,11 +70,10 @@ public class AndroidLauncher extends AndroidApplication { config.useCompass = false; config.useAccelerometer = false; - //TODO consider the following additional options, might be better than setting manually - //config.hideStatusBar - //config.useImmersiveMode - initialize(new ShatteredPixelDungeon( new AndroidPlatformSupport() ), config); + support = new AndroidPlatformSupport(); + + initialize(new ShatteredPixelDungeon(support), config); view = (GLSurfaceView)graphics.getView(); @@ -99,4 +100,9 @@ public class AndroidLauncher extends AndroidApplication { } } + @Override + public void onWindowFocusChanged(boolean hasFocus) { + super.onWindowFocusChanged(hasFocus); + support.updateSystemUI(); + } } \ No newline at end of file diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java index a9dee7994..95c485d80 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java @@ -118,10 +118,9 @@ public class AndroidPlatformSupport extends PlatformSupport { if (DeviceCompat.supportsFullScreen()){ if (SPDSettings.fullscreen()) { AndroidLauncher.instance.getWindow().getDecorView().setSystemUiVisibility( - View.SYSTEM_UI_FLAG_LAYOUT_STABLE | - View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | - View.SYSTEM_UI_FLAG_HIDE_NAVIGATION ); + View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY ); } else { AndroidLauncher.instance.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE );