You've already forked godot
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user