diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt index 73a295c9eb..baa3597b32 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt @@ -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()