From de5b2ad4600fe7a67982beef364d5cf6bc978c9f Mon Sep 17 00:00:00 2001 From: David Langley Date: Wed, 11 Aug 2021 15:00:27 +0100 Subject: [PATCH] simplify logic in bottom sheet and add comment --- vector/build.gradle | 3 --- .../list/actions/RoomListQuickActionsEpoxyController.kt | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/vector/build.gradle b/vector/build.gradle index 311f7ed172..7c1119f9c1 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -142,15 +142,12 @@ android { resValue "bool", "useLoginV1", "true" resValue "bool", "useLoginV2", "false" - - // NotificationSettingsV2 is disabled. To be released in conjunction with iOS/Web def useNotificationSettingsV2 = false buildConfigField "Boolean", "USE_NOTIFICATION_SETTINGS_V2", "${useNotificationSettingsV2}" resValue "bool", "useNotificationSettingsV1", "${!useNotificationSettingsV2}" resValue "bool", "useNotificationSettingsV2", "${useNotificationSettingsV2}" - buildConfigField "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy", "outboundSessionKeySharingStrategy", "im.vector.app.features.crypto.keysrequest.OutboundSessionKeySharingStrategy.WhenTyping" buildConfigField "Long", "VOICE_MESSAGE_DURATION_LIMIT_MS", "120_000L" diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListQuickActionsEpoxyController.kt b/vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListQuickActionsEpoxyController.kt index b109f0466d..7e39156b18 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListQuickActionsEpoxyController.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/actions/RoomListQuickActionsEpoxyController.kt @@ -47,10 +47,11 @@ class RoomListQuickActionsEpoxyController @Inject constructor( val notificationViewState = state.notificationSettingsViewState val roomSummary = notificationViewState.roomSummary() ?: return val host = this - val showFull = state.roomListActionsArgs.mode == RoomListActionsArgs.Mode.FULL val isV2 = BuildConfig.USE_NOTIFICATION_SETTINGS_V2 + // V2 always shows full details as we no longer display the sheet from RoomProfile > Notifications + val showFull = state.roomListActionsArgs.mode == RoomListActionsArgs.Mode.FULL || isV2 - if (showFull || isV2) { + if (showFull) { // Preview, favorite, settings bottomSheetRoomPreviewItem { id("room_preview") @@ -91,7 +92,7 @@ class RoomListQuickActionsEpoxyController @Inject constructor( RoomListQuickActionsSharedAction.NotificationsMute(roomSummary.roomId).toBottomSheetItem(3, selectedRoomState) } - if (showFull || isV2) { + if (showFull) { RoomListQuickActionsSharedAction.Leave(roomSummary.roomId, showIcon = !isV2).toBottomSheetItem(5) } }