Close search bar when opening bottom sheet and vice versa

This commit is contained in:
Sylvain Berfini 2026-01-08 12:17:24 +01:00
parent ef671bb609
commit 01a51574c3
2 changed files with 5 additions and 0 deletions

View file

@ -754,6 +754,9 @@ open class ConversationFragment : SlidingPaneChildFragment() {
viewModel.focusSearchBarEvent.observe(viewLifecycleOwner) {
it.consume { show ->
if (show) {
val bottomSheetBehavior = BottomSheetBehavior.from(binding.messageBottomSheet.root)
bottomSheetBehavior.state = BottomSheetBehavior.STATE_COLLAPSED
// To automatically open keyboard
binding.search.showKeyboard()
} else {
@ -1283,6 +1286,7 @@ open class ConversationFragment : SlidingPaneChildFragment() {
showDelivery: Boolean = false,
showReactions: Boolean = false
) {
viewModel.closeSearchBar()
binding.sendArea.messageToSend.hideKeyboard()
backPressedCallback.isEnabled = true

View file

@ -635,6 +635,7 @@ class MessageModel
if (textContent != null) {
computeTextContent(textContent, highlight)
}
isSelected.postValue(highlight.isNotEmpty())
}
@WorkerThread