Use Window Inset Compat api

This commit is contained in:
Naveen Singh
2024-06-14 12:36:21 +05:30
parent ba2f318d4e
commit 557f956396

View File

@@ -84,7 +84,8 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
val window = window.window!!
WindowCompat.setDecorFitsSystemWindows(window, false)
window.decorView.setOnApplyWindowInsetsListener { _, insets ->
val bottom = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom
val windowInsets = WindowInsetsCompat.toWindowInsetsCompat(insets)
val bottom = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom
binding.keyboardHolder.updatePadding(bottom = bottom)
insets
}