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:
parent
5abed52fd9
commit
2f4c3d411c
9 changed files with 97 additions and 18 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue