From ec1dbad6379cdd1313ddd109599d9878b8a3fe00 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 25 Aug 2025 15:35:59 -0400 Subject: [PATCH] v3.2.2: also fixed a crash bug with new Android fullscreen (ugh!) --- .../android/AndroidPlatformSupport.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 b227d9afa..7d98405f0 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java @@ -30,7 +30,6 @@ import android.view.WindowInsets; import android.view.WindowManager; import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.g2d.PixmapPacker; import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator; @@ -51,8 +50,8 @@ public class AndroidPlatformSupport extends PlatformSupport { public boolean supportsFullScreen(){ //Android supports hiding the navigation bar or gesture bar, if it is present if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - WindowInsets insets = ((AndroidApplication)Gdx.app).getApplicationWindow().getDecorView().getRootWindowInsets(); - return insets.getStableInsetBottom() > 0 || insets.getStableInsetRight() > 0 || insets.getStableInsetLeft() > 0; + WindowInsets insets = AndroidLauncher.instance.getApplicationWindow().getDecorView().getRootWindowInsets(); + return insets != null && (insets.getStableInsetBottom() > 0 || insets.getStableInsetRight() > 0 || insets.getStableInsetLeft() > 0); } else { return true; }