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 {
|
} else {
|
||||||
if (rootView.rootWindowInsets != null) {
|
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 windowInsets = WindowInsetsCompat.toWindowInsetsCompat(rootView.rootWindowInsets)
|
||||||
val insets = windowInsets.getInsets(getInsetType())
|
val insets = windowInsets.getInsets(getInsetType())
|
||||||
rootView.setPadding(insets.left, insets.top, insets.right, insets.bottom)
|
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 ->
|
ViewCompat.setOnApplyWindowInsetsListener(rootView) { v: View, insets: WindowInsetsCompat ->
|
||||||
v.post {
|
v.post {
|
||||||
if (useImmersive.get() && Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
if (useImmersive.get()) {
|
||||||
// Fixes issue where padding remained visible in immersive mode on some devices.
|
|
||||||
v.setPadding(0, 0, 0, 0)
|
v.setPadding(0, 0, 0, 0)
|
||||||
} else {
|
} else {
|
||||||
val windowInsets = insets.getInsets(getInsetType())
|
val windowInsets = insets.getInsets(getInsetType())
|
||||||
|
|||||||
Reference in New Issue
Block a user