Merge pull request #6868 from vector-im/feature/eric/space-settings

Space Switching: Adds Toolbar Click To Open Space Settings
This commit is contained in:
Eric Decanini 2022-08-23 09:59:09 +02:00 committed by GitHub
commit 2830664dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

1
changelog.d/6859.wip Normal file
View File

@ -0,0 +1 @@
[New Layout] Adds space settings accessible through clicking the toolbar

View File

@ -291,11 +291,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 {