forked from github/wulkanowy-mirror
Fix ime overlaping message content (#2199)
This commit is contained in:
parent
d8f71f48f3
commit
3fdd47c221
@ -142,10 +142,15 @@ class SendMessageActivity : BaseActivity<SendMessagePresenter, ActivitySendMessa
|
||||
|
||||
private fun initializeMessageContainer() {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(binding.sendMessageScroll) { view, insets ->
|
||||
val bottomInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
||||
val navigationBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
||||
val imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime())
|
||||
|
||||
view.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
bottomMargin = bottomInsets.bottom
|
||||
bottomMargin = if (imeInsets.bottom > navigationBarInsets.bottom) {
|
||||
imeInsets.bottom
|
||||
} else {
|
||||
navigationBarInsets.bottom
|
||||
}
|
||||
}
|
||||
WindowInsetsCompat.CONSUMED
|
||||
}
|
||||
|
@ -22,17 +22,15 @@
|
||||
|
||||
<io.github.wulkanowy.materialchipsinput.ConsumedNestedScrollView
|
||||
android:id="@+id/sendMessageScroll"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:fillViewport="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/send_app_bar">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/sendMessageContent"
|
||||
|
Loading…
x
Reference in New Issue
Block a user