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 3f868e02fe
commit 3b561275a4
2 changed files with 5 additions and 0 deletions

View file

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

View file

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