Implements hide modal on click dim view

This commit is contained in:
ericdecanini 2022-05-05 18:52:20 +02:00
parent 051adad0ed
commit 4ee5b90f82
1 changed files with 17 additions and 9 deletions

View File

@ -144,15 +144,11 @@ class HomeDetailFragment @Inject constructor(
}
views.allChatsLayout.setOnClickListener {
if (views.spaceModalFragment.isVisible) {
views.spaceModalFragment.isVisible = false
views.dimView.isVisible = false
views.toolbarChevron.rotation = 0F
} else {
views.spaceModalFragment.isVisible = true
views.dimView.isVisible = true
views.toolbarChevron.rotation = 90F
}
toggleModalVisibility()
}
views.dimView.setOnClickListener {
toggleModalVisibility()
}
viewModel.onEach(HomeDetailViewState::showDialPadTab) { showDialPadTab ->
@ -202,6 +198,18 @@ class HomeDetailFragment @Inject constructor(
}
}
private fun toggleModalVisibility() {
if (views.spaceModalFragment.isVisible) {
views.spaceModalFragment.isVisible = false
views.dimView.isVisible = false
views.toolbarChevron.rotation = 0F
} else {
views.spaceModalFragment.isVisible = true
views.dimView.isVisible = true
views.toolbarChevron.rotation = 90F
}
}
private fun handleCallStarted() {
dismissLoadingDialog()
val fragmentTag = HomeTab.DialPad.toFragmentTag()