mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Android: Fix root window shrinks when keyboard shows
This commit is contained in:
parent
6fd949a6dc
commit
941aff3c06
1 changed files with 2 additions and 3 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue