simplify logic in bottom sheet and add comment

This commit is contained in:
David Langley 2021-08-11 15:00:27 +01:00
parent c8efb293cf
commit de5b2ad460
2 changed files with 4 additions and 6 deletions

View File

@ -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"

View File

@ -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)
}
}