v0.7.4b: fixed additional rare system UI issues
This commit is contained in:
@@ -32,6 +32,7 @@ import android.telephony.TelephonyManager;
|
||||
|
||||
import com.badlogic.gdx.backends.android.AndroidApplication;
|
||||
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.audio.Music;
|
||||
@@ -60,9 +61,13 @@ public class AndroidLauncher extends AndroidApplication {
|
||||
Game.versionCode = 0;
|
||||
}
|
||||
|
||||
// grab preferences directly using our instance first
|
||||
// so that we don't need to rely on Gdx.app, which isn't initialized yet.
|
||||
SPDSettings.setPrefsFromInstance(instance);
|
||||
|
||||
//set desired orientation (if it exists) before initializing the app.
|
||||
if (getPreferences("ShatteredPixelDungeon").contains("landscape")) {
|
||||
if (getPreferences("ShatteredPixelDungeon").getBoolean("landscape")){
|
||||
if (SPDSettings.landscapeFromSettings() != null) {
|
||||
if (SPDSettings.landscapeFromSettings()){
|
||||
instance.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
||||
} else {
|
||||
instance.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
||||
@@ -83,6 +88,8 @@ public class AndroidLauncher extends AndroidApplication {
|
||||
|
||||
support = new AndroidPlatformSupport();
|
||||
|
||||
support.updateSystemUI();
|
||||
|
||||
initialize(new ShatteredPixelDungeon(support), config);
|
||||
|
||||
view = (GLSurfaceView)graphics.getView();
|
||||
@@ -115,4 +122,10 @@ public class AndroidLauncher extends AndroidApplication {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
support.updateSystemUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
|
||||
super.onMultiWindowModeChanged(isInMultiWindowMode);
|
||||
support.updateSystemUI();
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class AndroidPlatformSupport extends PlatformSupport {
|
||||
WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
}
|
||||
|
||||
if (DeviceCompat.supportsFullScreen()){
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
|
||||
if (SPDSettings.fullscreen()) {
|
||||
AndroidLauncher.instance.getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
|
||||
Reference in New Issue
Block a user