mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Check if current fragment matches before going back
This commit is contained in:
parent
39fba60066
commit
0dbd403d5b
4 changed files with 28 additions and 16 deletions
|
|
@ -325,10 +325,13 @@ class ConversationFragment : SlidingPaneChildFragment() {
|
|||
override fun goBack(): Boolean {
|
||||
sharedViewModel.closeSlidingPaneEvent.value = Event(true)
|
||||
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action = ConversationFragmentDirections.actionConversationFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
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?) {
|
||||
|
|
|
|||
|
|
@ -81,10 +81,13 @@ class ContactFragment : SlidingPaneChildFragment() {
|
|||
override fun goBack(): Boolean {
|
||||
sharedViewModel.closeSlidingPaneEvent.value = Event(true)
|
||||
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action = ContactFragmentDirections.actionContactFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
if (findNavController().currentDestination?.id == R.id.contactFragment) {
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action = ContactFragmentDirections.actionContactFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
|||
|
|
@ -64,10 +64,13 @@ class HistoryFragment : SlidingPaneChildFragment() {
|
|||
override fun goBack(): Boolean {
|
||||
sharedViewModel.closeSlidingPaneEvent.value = Event(true)
|
||||
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action = HistoryFragmentDirections.actionHistoryFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
if (findNavController().currentDestination?.id == R.id.historyFragment) {
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action = HistoryFragmentDirections.actionHistoryFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
|
|
|||
|
|
@ -82,10 +82,13 @@ class MeetingFragment : SlidingPaneChildFragment() {
|
|||
override fun goBack(): Boolean {
|
||||
sharedViewModel.closeSlidingPaneEvent.value = Event(true)
|
||||
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action = MeetingFragmentDirections.actionMeetingFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
if (findNavController().currentDestination?.id == R.id.meetingFragment) {
|
||||
// If not done this fragment won't be paused, which will cause us issues
|
||||
val action = MeetingFragmentDirections.actionMeetingFragmentToEmptyFragment()
|
||||
findNavController().navigate(action)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue