v3.2.2: also fixed a crash bug with new Android fullscreen (ugh!)

This commit is contained in:
Evan Debenham
2025-08-25 15:35:59 -04:00
parent 2f66d4ce10
commit ec1dbad637

View File

@@ -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;
}