From bba58d25e13901cad669f4896fc6c1c1cfe2dd97 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 22 Nov 2019 14:54:22 +0100 Subject: [PATCH] Do not show long click help if only invitation are displayed --- CHANGES.md | 2 +- .../features/home/room/list/RoomSummaryController.kt | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ed85d018a3..65d046bdf3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,7 +11,7 @@ Other changes: - Bugfix 🐛: - - + - Do not show long click help if only invitation are displayed Translations 🗣: - diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt index 74dab6563f..4107bf01b2 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt @@ -24,8 +24,8 @@ import im.vector.riotx.R import im.vector.riotx.core.epoxy.helpFooterItem import im.vector.riotx.core.epoxy.noResultItem import im.vector.riotx.core.resources.StringProvider -import im.vector.riotx.features.home.RoomListDisplayMode import im.vector.riotx.core.resources.UserPreferencesProvider +import im.vector.riotx.features.home.RoomListDisplayMode import im.vector.riotx.features.home.room.filtered.FilteredRoomFooterItem import im.vector.riotx.features.home.room.filtered.filteredRoomFooterItem import javax.inject.Inject @@ -63,7 +63,7 @@ class RoomSummaryController @Inject constructor(private val stringProvider: Stri RoomListDisplayMode.SHARE -> { buildFilteredRooms(nonNullViewState) } - else -> { + else -> { var showHelp = false val roomSummaries = nonNullViewState.asyncFilteredRooms() roomSummaries?.forEach { (category, summaries) -> @@ -80,7 +80,10 @@ class RoomSummaryController @Inject constructor(private val stringProvider: Stri nonNullViewState.joiningErrorRoomsIds, nonNullViewState.rejectingRoomsIds, nonNullViewState.rejectingErrorRoomsIds) - showHelp = userPreferencesProvider.shouldShowLongClickOnRoomHelp() + // Never set showHelp to true for invitation + if (category != RoomCategory.INVITE) { + showHelp = userPreferencesProvider.shouldShowLongClickOnRoomHelp() + } } } } @@ -108,7 +111,7 @@ class RoomSummaryController @Inject constructor(private val stringProvider: Stri when { viewState.displayMode == RoomListDisplayMode.FILTERED -> addFilterFooter(viewState) - filteredSummaries.isEmpty() -> addEmptyFooter() + filteredSummaries.isEmpty() -> addEmptyFooter() } }