mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-08-15 06:56:30 +00:00
Merge pull request #819 from spradhan7656/main
android 10 or below chat ui input field padding issue
This commit is contained in:
commit
1774414f2e
@ -1,5 +1,6 @@
|
||||
package com.bitchat.android.ui
|
||||
|
||||
import android.os.Build
|
||||
import com.bitchat.android.ui.theme.BitchatFontFamily
|
||||
// [Goose] Bridge file share events to ViewModel via dispatcher is installed in ChatScreen composition
|
||||
|
||||
@ -259,8 +260,19 @@ fun ChatScreen(viewModel: ChatViewModel) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.windowInsetsPadding(WindowInsets.ime) // This handles keyboard insets
|
||||
.windowInsetsPadding(WindowInsets.navigationBars) // Add bottom padding when keyboard is not expanded
|
||||
.then(
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
// Android 11+: Handle both IME and navigation bar insets in Compose
|
||||
Modifier.windowInsetsPadding(
|
||||
WindowInsets.ime.union(WindowInsets.navigationBars)
|
||||
)
|
||||
} else {
|
||||
|
||||
// Android 10 and below: Window is resized by the system (adjustResize),
|
||||
// so only account for the navigation bar.
|
||||
Modifier.windowInsetsPadding(WindowInsets.navigationBars)
|
||||
}
|
||||
)
|
||||
) {
|
||||
Box(modifier = Modifier.weight(1f)) {
|
||||
// Messages area - takes up available space, will compress when keyboard appears
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user