You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-21 14:57:09 +00:00
Merge pull request #112585 from syntaxerror247/fix-ui-issue
Android: Fix root window shrinking when keyboard appears
This commit is contained in:
@@ -382,7 +382,7 @@ class Godot private constructor(val context: Context) {
|
||||
}
|
||||
} else {
|
||||
if (rootView.rootWindowInsets != null) {
|
||||
if (!useImmersive.get() || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)) {
|
||||
if (!useImmersive.get()) {
|
||||
val windowInsets = WindowInsetsCompat.toWindowInsetsCompat(rootView.rootWindowInsets)
|
||||
val insets = windowInsets.getInsets(getInsetType())
|
||||
rootView.setPadding(insets.left, insets.top, insets.right, insets.bottom)
|
||||
@@ -391,8 +391,7 @@ class Godot private constructor(val context: Context) {
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(rootView) { v: View, insets: WindowInsetsCompat ->
|
||||
v.post {
|
||||
if (useImmersive.get() && Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||
// Fixes issue where padding remained visible in immersive mode on some devices.
|
||||
if (useImmersive.get()) {
|
||||
v.setPadding(0, 0, 0, 0)
|
||||
} else {
|
||||
val windowInsets = insets.getInsets(getInsetType())
|
||||
|
||||
Reference in New Issue
Block a user