Skip to content

Commit

Permalink
feat: prevent keyboard controller to report new ime insets when liste…
Browse files Browse the repository at this point in the history
…ner is disabled
  • Loading branch information
jpudysz committed Oct 2, 2024
1 parent 7b98bed commit 7f0ccc4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions android/src/main/java/com/unistyles/Platform.kt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ class Platform(private val reactApplicationContext: ReactApplicationContext) {
}

val insets = insetsCompat.getInsets(WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout())
val bottomIME = insetsCompat.getInsets(WindowInsetsCompat.Type.ime()).bottom

// fix for keyboard controller, that triggers WindowInsetsListener
if(!hasAnimatedInsets && bottomIME != 0) {
return
}

if (!hasAnimatedInsets) {
this.insets = Insets(statusBarTopInset, insets.bottom, insets.left, insets.right)
Expand Down

0 comments on commit 7f0ccc4

Please sign in to comment.