From f5851a0bf85a9ce067b1221d3409be6c3a8b7c27 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Tue, 10 May 2022 19:23:08 +0200 Subject: [PATCH] Fixes space name turning to all chats when switching bot nav --- .../app/features/home/HomeDetailFragment.kt | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 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 4817be82cb..cfcbdd65ae 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 @@ -359,19 +359,19 @@ class HomeDetailFragment @Inject constructor( private fun onGroupChange(groupSummary: GroupSummary?) { hideModal() -// if (groupSummary == null) { -// views.backButtonLayout.isVisible = false -// views.groupToolbarSpaceTitleView.isVisible = false -// views.groupToolbarSpaceTitleView.text = getString(R.string.all_chats) -// ImageViewCompat.setImageTintList(views.toolbarChevron, ColorStateList.valueOf(resources.getColor(R.color.palette_element_green))) -// views.groupToolbarTitleView.text = getString(R.string.all_chats) -// } else { -// views.backButtonLayout.isVisible = true -// views.groupToolbarSpaceTitleView.isVisible = true -// views.groupToolbarSpaceTitleView.text = groupSummary.displayName -// views.groupToolbarTitleView.text = groupSummary.displayName -// ImageViewCompat.setImageTintList(views.toolbarChevron, ColorStateList.valueOf(MaterialColors.getColor(views.toolbarChevron, R.attr.vctr_message_text_color))) -// } + if (groupSummary == null) { + views.backButtonLayout.isVisible = false + views.groupToolbarSpaceTitleView.isVisible = false + views.groupToolbarSpaceTitleView.text = getString(R.string.all_chats) + ImageViewCompat.setImageTintList(views.toolbarChevron, ColorStateList.valueOf(resources.getColor(R.color.palette_element_green))) + views.groupToolbarTitleView.text = getString(R.string.all_chats) + } else { + views.backButtonLayout.isVisible = true + views.groupToolbarSpaceTitleView.isVisible = true + views.groupToolbarSpaceTitleView.text = groupSummary.displayName + views.groupToolbarTitleView.text = groupSummary.displayName + ImageViewCompat.setImageTintList(views.toolbarChevron, ColorStateList.valueOf(MaterialColors.getColor(views.toolbarChevron, R.attr.vctr_message_text_color))) + } } private fun onSpaceChange(spaceSummary: RoomSummary?) { @@ -468,7 +468,6 @@ class HomeDetailFragment @Inject constructor( private fun updateUIForTab(tab: HomeTab) { views.bottomNavigationView.menu.findItem(tab.toMenuId()).isChecked = true - views.groupToolbarTitleView.text = getString(R.string.all_chats) updateSelectedFragment(tab) invalidateOptionsMenu() }