mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Android Editor: Fix padding for display cutout in fullscreen mode
This commit is contained in:
parent
ef34c3d534
commit
acdace4f00
1 changed files with 6 additions and 1 deletions
|
|
@ -392,7 +392,12 @@ class Godot private constructor(val context: Context) {
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(rootView) { v: View, insets: WindowInsetsCompat ->
|
ViewCompat.setOnApplyWindowInsetsListener(rootView) { v: View, insets: WindowInsetsCompat ->
|
||||||
v.post {
|
v.post {
|
||||||
if (useImmersive.get()) {
|
if (useImmersive.get()) {
|
||||||
v.setPadding(0, 0, 0, 0)
|
if (isEditorBuild()) {
|
||||||
|
val windowInsets = insets.getInsets(WindowInsetsCompat.Type.displayCutout())
|
||||||
|
v.setPadding(windowInsets.left, windowInsets.top, windowInsets.right, windowInsets.bottom)
|
||||||
|
} else {
|
||||||
|
v.setPadding(0, 0, 0, 0)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val windowInsets = insets.getInsets(getInsetType())
|
val windowInsets = insets.getInsets(getInsetType())
|
||||||
v.setPadding(windowInsets.left, windowInsets.top, windowInsets.right, windowInsets.bottom)
|
v.setPadding(windowInsets.left, windowInsets.top, windowInsets.right, windowInsets.bottom)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue