Skip to content

Commit 0ce7c46

Browse files
authored
fix: ensure proper insets are applied on startup (#307)
Refs: #117
1 parent 6548a7a commit 0ce7c46

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515
- Fixed invisible numbers in the top row ([#100])
16+
- Fixed overlap between keyboard and navigation bar ([#117])
1617

1718
## [1.5.0] - 2025-09-23
1819
### Added
@@ -102,6 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
102103
[#47]: https://github.com/FossifyOrg/Keyboard/issues/47
103104
[#78]: https://github.com/FossifyOrg/Keyboard/issues/78
104105
[#100]: https://github.com/FossifyOrg/Keyboard/issues/100
106+
[#117]: https://github.com/FossifyOrg/Keyboard/issues/117
105107
[#133]: https://github.com/FossifyOrg/Keyboard/issues/133
106108
[#134]: https://github.com/FossifyOrg/Keyboard/issues/134
107109
[#136]: https://github.com/FossifyOrg/Keyboard/issues/136

app/src/main/kotlin/org/fossify/keyboard/services/SimpleKeyboardIME.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import androidx.autofill.inline.v1.InlineSuggestionUi
3131
import androidx.core.graphics.drawable.toBitmap
3232
import androidx.core.view.ViewCompat
3333
import androidx.core.view.WindowCompat
34-
import androidx.core.view.WindowInsetsCompat
34+
import androidx.core.view.WindowInsetsCompat.Type
3535
import androidx.core.view.updatePadding
3636
import org.fossify.commons.extensions.*
3737
import org.fossify.commons.helpers.*
@@ -96,6 +96,9 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
9696
override fun onStartInputView(editorInfo: EditorInfo?, restarting: Boolean) {
9797
super.onStartInputView(editorInfo, restarting)
9898
updateBackgroundColors()
99+
binding.keyboardHolder.post {
100+
ViewCompat.requestApplyInsets(binding.keyboardHolder)
101+
}
99102
}
100103

101104
override fun onPress(primaryCode: Int) {
@@ -557,8 +560,8 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared
557560
window.window?.apply {
558561
WindowCompat.enableEdgeToEdge(this)
559562
ViewCompat.setOnApplyWindowInsetsListener(binding.keyboardHolder) { view, insets ->
560-
val bottomPadding = insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom
561-
binding.keyboardHolder.updatePadding(bottom = bottomPadding)
563+
val system = insets.getInsetsIgnoringVisibility(Type.navigationBars())
564+
binding.keyboardHolder.updatePadding(bottom = system.bottom)
562565
insets
563566
}
564567
}

0 commit comments

Comments
 (0)