From 4ee5b90f8248e3786d25b9acab93d6014527110f Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Thu, 5 May 2022 18:52:20 +0200 Subject: [PATCH] Implements hide modal on click dim view --- .../app/features/home/HomeDetailFragment.kt | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) 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()