mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Dismiss chat message long press view if visible when doing a back gesture
This commit is contained in:
parent
8a39529fd1
commit
6826a51307
1 changed files with 11 additions and 2 deletions
|
|
@ -325,12 +325,20 @@ open class ConversationFragment : SlidingPaneChildFragment() {
|
|||
}
|
||||
|
||||
val bottomSheetBehavior = BottomSheetBehavior.from(binding.messageBottomSheet.root)
|
||||
if (bottomSheetBehavior.state != BottomSheetBehavior.STATE_HIDDEN) {
|
||||
Log.i("$TAG Bottom sheet is visible, hiding it instead of going back")
|
||||
if (bottomSheetBehavior.state != BottomSheetBehavior.STATE_HIDDEN && bottomSheetBehavior.state != BottomSheetBehavior.STATE_COLLAPSED) {
|
||||
Log.i(
|
||||
"$TAG Bottom sheet isn't hidden nor collapsed, hiding it instead of going back"
|
||||
)
|
||||
bottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
return
|
||||
}
|
||||
|
||||
if (messageLongPressViewModel.visible.value == true) {
|
||||
Log.i("$TAG Message long press menu is visible, hiding it instead of going back")
|
||||
messageLongPressViewModel.dismiss()
|
||||
return
|
||||
}
|
||||
|
||||
Log.i("$TAG Search bar is closed & no bottom sheet is opened, going back")
|
||||
isEnabled = false
|
||||
try {
|
||||
|
|
@ -1151,6 +1159,7 @@ open class ConversationFragment : SlidingPaneChildFragment() {
|
|||
}
|
||||
}
|
||||
messageLongPressViewModel.visible.value = true
|
||||
backPressedCallback.isEnabled = true
|
||||
}
|
||||
|
||||
@UiThread
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue