1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-21 14:57:09 +00:00

Address API 35 UI behavior changes

- Fix issue on foldable where the embedded window would obscure the main window when launching
- Fix edge-to-edge support for non-immersive apps / games
- Add edge-to-edge export option to allow non-immersive apps / games to extend edge to edge
This commit is contained in:
Fredia Huya-Kouadio
2025-06-19 16:01:06 -07:00
parent 5abed52fd9
commit 2f4c3d411c
9 changed files with 97 additions and 18 deletions

View File

@@ -30,11 +30,13 @@
package com.godot.game;
import org.godotengine.godot.Godot;
import org.godotengine.godot.GodotActivity;
import android.os.Bundle;
import android.util.Log;
import androidx.activity.EdgeToEdge;
import androidx.core.splashscreen.SplashScreen;
/**
@@ -54,9 +56,30 @@ public class GodotApp extends GodotActivity {
}
}
private final Runnable updateImmersiveAndEdgeToEdgeModes = () -> {
Godot godot = getGodot();
if (godot != null) {
godot.enableImmersiveMode(godot.isInImmersiveMode(), true);
godot.enableEdgeToEdge(godot.isInEdgeToEdgeMode(), true);
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
SplashScreen.installSplashScreen(this);
EdgeToEdge.enable(this);
super.onCreate(savedInstanceState);
}
@Override
public void onResume() {
super.onResume();
updateImmersiveAndEdgeToEdgeModes.run();
}
@Override
public void onGodotMainLoopStarted() {
super.onGodotMainLoopStarted();
runOnUiThread(updateImmersiveAndEdgeToEdgeModes);
}
}