Skip to content
Snippets Groups Projects
Commit 95e8c068 authored by Vitalii Nikitchyn's avatar Vitalii Nikitchyn Committed by Vitalii Nikitchyn
Browse files

HomeActivity settings backPress bugfix

GitLab: #1629
Change-Id: Ia753b8da5d50685b689fc63693be68b64cec158a
parent ad41c226
No related branches found
No related tags found
No related merge requests found
......@@ -108,16 +108,20 @@ class HomeActivity : AppCompatActivity(), ContactPickerFragment.OnContactedPicke
private val conversationBackPressedCallback: OnBackPressedCallback =
object : OnBackPressedCallback(false) {
override fun handleOnBackPressed() {
removeFragment(fConversation)
fConversation = null
if (supportFragmentManager.backStackEntryCount == 0) {
removeFragment(fConversation)
fConversation = null
// Hiding the conversation
if (mBinding?.panel?.isSlideable == true) { // No space to keep the pane open
mBinding?.panel?.closePane()
} else showWelcomeFragment()
// Hiding the conversation
if (mBinding?.panel?.isSlideable == true) { // No space to keep the pane open
mBinding?.panel?.closePane()
} else showWelcomeFragment()
// Next back press doesn't have to be handled by this callback.
isEnabled = false
// Next back press doesn't have to be handled by this callback.
isEnabled = false
} else {
supportFragmentManager.popBackStack()
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment