From 9c47c82da4b3ee75df05e6d5437487bbb8a4d683 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Wed, 17 Aug 2022 22:23:39 +0200 Subject: [PATCH] Adds click action to toolbar to open space settings --- .../im/vector/app/features/home/NewHomeDetailFragment.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt index 839ae6da88..74b7dcce51 100644 --- a/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/NewHomeDetailFragment.kt @@ -297,11 +297,20 @@ class NewHomeDetailFragment @Inject constructor( } } + views.collapsingToolbar.debouncedClicks(::openSpaceSettings) + views.toolbar.debouncedClicks(::openSpaceSettings) + views.avatar.debouncedClicks { navigator.openSettings(requireContext()) } } + private fun openSpaceSettings() = withState(viewModel) { viewState -> + viewState.selectedSpace?.let { + sharedActionViewModel.post(HomeActivitySharedAction.ShowSpaceSettings(it.roomId)) + } + } + private fun setupBottomNavigationView() { views.bottomNavigationView.menu.findItem(R.id.bottom_action_notification).isVisible = vectorPreferences.labAddNotificationTab() views.bottomNavigationView.setOnItemSelectedListener {