Skip to content

Commit

Permalink
Merge pull request #302 from jpudysz/fature/keyboard-controller
Browse files Browse the repository at this point in the history
feat: prevent keyboard controller to report new ime insets when listener is disabled
  • Loading branch information
jpudysz authored Oct 2, 2024
2 parents 7b98bed + 7f0ccc4 commit e09e959
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 e09e959

Please sign in to comment.