v0.7.4b: fixed errors with immersive mode not sticking in all cases
This commit is contained in:
parent
785726f4f8
commit
489ea63752
android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue
Block a user