mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Another attempt at preventing an empty fragment to be visible sometimes when going back from a conversation
This commit is contained in:
parent
febc6a85d3
commit
6a41f7f67d
1 changed files with 15 additions and 14 deletions
|
|
@ -389,21 +389,22 @@ open class ConversationFragment : SlidingPaneChildFragment() {
|
|||
}
|
||||
|
||||
override fun goBack(): Boolean {
|
||||
val backStack = findNavController().currentBackStackEntry
|
||||
if (backStack == null || backStack.destination.id == R.id.emptyFragment || !findNavController().popBackStack()) {
|
||||
sharedViewModel.closeSlidingPaneEvent.value = Event(true)
|
||||
sharedViewModel.displayedChatRoom = null
|
||||
|
||||
if (findNavController().currentDestination?.id == R.id.conversationFragment) {
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action =
|
||||
ConversationFragmentDirections.actionConversationFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
if (viewModel.isCallConversation.value == true) {
|
||||
Log.i("$TAG Conversation is call related, going back to previous fragment")
|
||||
return findNavController().popBackStack()
|
||||
}
|
||||
return true
|
||||
|
||||
sharedViewModel.closeSlidingPaneEvent.value = Event(true)
|
||||
sharedViewModel.displayedChatRoom = null
|
||||
|
||||
if (findNavController().currentDestination?.id == R.id.conversationFragment) {
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action =
|
||||
ConversationFragmentDirections.actionConversationFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue