From 77b87af52acb6fb2928f6e140ae63a3c86d71f5a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 16 Oct 2024 18:15:36 +0200 Subject: [PATCH 01/13] Move RoomBadge to atomic package and rename to MatrixBadge --- .../roomdetails/impl/RoomDetailsView.kt | 14 +++--- .../atomic/atoms/MatrixBadgeAtom.kt | 49 +++++++++---------- .../tests/konsist/KonsistPreviewTest.kt | 6 +-- 3 files changed, 32 insertions(+), 37 deletions(-) rename features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/components/RoomBadge.kt => libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/MatrixBadgeAtom.kt (75%) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index b3b017f0e3..6af32facf4 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -41,10 +41,10 @@ import im.vector.app.features.analytics.plan.Interaction import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons import io.element.android.features.leaveroom.api.LeaveRoomView -import io.element.android.features.roomdetails.impl.components.RoomBadge import io.element.android.features.userprofile.shared.blockuser.BlockUserDialogs import io.element.android.features.userprofile.shared.blockuser.BlockUserSection import io.element.android.libraries.architecture.coverage.ExcludeFromCoverage +import io.element.android.libraries.designsystem.atomic.atoms.MatrixBadgeAtom import io.element.android.libraries.designsystem.components.ClickableLinkText import io.element.android.libraries.designsystem.components.avatar.AvatarData import io.element.android.libraries.designsystem.components.avatar.AvatarSize @@ -412,23 +412,23 @@ private fun BadgeList( horizontalArrangement = Arrangement.spacedBy(8.dp), ) { if (isEncrypted) { - RoomBadge.View( + MatrixBadgeAtom.View( text = stringResource(R.string.screen_room_details_badge_encrypted), icon = CompoundIcons.LockSolid(), - type = RoomBadge.Type.Positive, + type = MatrixBadgeAtom.Type.Positive, ) } else { - RoomBadge.View( + MatrixBadgeAtom.View( text = stringResource(R.string.screen_room_details_badge_not_encrypted), icon = CompoundIcons.LockOff(), - type = RoomBadge.Type.Neutral, + type = MatrixBadgeAtom.Type.Neutral, ) } if (isPublic) { - RoomBadge.View( + MatrixBadgeAtom.View( text = stringResource(R.string.screen_room_details_badge_public), icon = CompoundIcons.Public(), - type = RoomBadge.Type.Neutral, + type = MatrixBadgeAtom.Type.Neutral, ) } } diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/components/RoomBadge.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/MatrixBadgeAtom.kt similarity index 75% rename from features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/components/RoomBadge.kt rename to libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/MatrixBadgeAtom.kt index 84abe2addf..2e2b4b07fb 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/components/RoomBadge.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/MatrixBadgeAtom.kt @@ -5,7 +5,7 @@ * Please see LICENSE in the repository root for full details. */ -package io.element.android.features.roomdetails.impl.components +package io.element.android.libraries.designsystem.atomic.atoms import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.vector.ImageVector @@ -21,14 +21,15 @@ import io.element.android.libraries.designsystem.theme.badgeNeutralContentColor import io.element.android.libraries.designsystem.theme.badgePositiveBackgroundColor import io.element.android.libraries.designsystem.theme.badgePositiveContentColor -object RoomBadge { +object MatrixBadgeAtom { enum class Type { Positive, Neutral, Negative } - @Composable fun View( + @Composable + fun View( text: String, icon: ImageVector, type: Type, @@ -60,36 +61,30 @@ object RoomBadge { @PreviewsDayNight @Composable -internal fun RoomBadgePositivePreview() { - ElementPreview { - RoomBadge.View( - text = "Trusted", - icon = CompoundIcons.Verified(), - type = RoomBadge.Type.Positive, - ) - } +internal fun MatrixBadgeAtomPositivePreview() = ElementPreview { + MatrixBadgeAtom.View( + text = "Trusted", + icon = CompoundIcons.Verified(), + type = MatrixBadgeAtom.Type.Positive, + ) } @PreviewsDayNight @Composable -internal fun RoomBadgeNeutralPreview() { - ElementPreview { - RoomBadge.View( - text = "Public room", - icon = CompoundIcons.Public(), - type = RoomBadge.Type.Neutral, - ) - } +internal fun MatrixBadgeAtomNeutralPreview() = ElementPreview { + MatrixBadgeAtom.View( + text = "Public room", + icon = CompoundIcons.Public(), + type = MatrixBadgeAtom.Type.Neutral, + ) } @PreviewsDayNight @Composable -internal fun RoomBadgeNegativePreview() { - ElementPreview { - RoomBadge.View( - text = "Not trusted", - icon = CompoundIcons.Error(), - type = RoomBadge.Type.Negative, - ) - } +internal fun MatrixBadgeAtomNegativePreview() = ElementPreview { + MatrixBadgeAtom.View( + text = "Not trusted", + icon = CompoundIcons.Error(), + type = MatrixBadgeAtom.Type.Negative, + ) } diff --git a/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistPreviewTest.kt b/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistPreviewTest.kt index 9db116ebc5..6a72fa3cd9 100644 --- a/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistPreviewTest.kt +++ b/tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistPreviewTest.kt @@ -71,6 +71,9 @@ class KonsistPreviewTest { "IconsCompoundPreview", "IconsOtherPreview", "MarkdownTextComposerEditPreview", + "MatrixBadgeAtomPositivePreview", + "MatrixBadgeAtomNeutralPreview", + "MatrixBadgeAtomNegativePreview", "MentionSpanPreview", "MessageComposerViewVoicePreview", "MessagesReactionButtonAddPreview", @@ -95,9 +98,6 @@ class KonsistPreviewTest { "PollContentViewEndedPreview", "PollContentViewUndisclosedPreview", "ReadReceiptBottomSheetPreview", - "RoomBadgePositivePreview", - "RoomBadgeNeutralPreview", - "RoomBadgeNegativePreview", "RoomMemberListViewBannedPreview", "SasEmojisPreview", "SecureBackupSetupViewChangePreview", From 1ca8c5131bc94c923332d8b62eaa1669ae8069c6 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 16 Oct 2024 18:30:16 +0200 Subject: [PATCH 02/13] Change model and create MatrixBadgeRowMolecule --- .../roomdetails/impl/RoomDetailsView.kt | 81 ++++++++++--------- .../atomic/atoms/MatrixBadgeAtom.kt | 44 ++++++---- .../molecules/MatrixBadgeRowMolecule.kt | 33 ++++++++ 3 files changed, 104 insertions(+), 54 deletions(-) create mode 100644 libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/MatrixBadgeRowMolecule.kt diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index 6af32facf4..8291b3e1c8 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -45,6 +45,7 @@ import io.element.android.features.userprofile.shared.blockuser.BlockUserDialogs import io.element.android.features.userprofile.shared.blockuser.BlockUserSection import io.element.android.libraries.architecture.coverage.ExcludeFromCoverage import io.element.android.libraries.designsystem.atomic.atoms.MatrixBadgeAtom +import io.element.android.libraries.designsystem.atomic.molecules.MatrixBadgeRowMolecule import io.element.android.libraries.designsystem.components.ClickableLinkText import io.element.android.libraries.designsystem.components.avatar.AvatarData import io.element.android.libraries.designsystem.components.avatar.AvatarSize @@ -84,6 +85,7 @@ import io.element.android.libraries.ui.strings.CommonStrings import io.element.android.services.analytics.compose.LocalAnalyticsService import io.element.android.services.analyticsproviders.api.trackers.captureInteraction import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toPersistentList @Composable @@ -114,9 +116,9 @@ fun RoomDetailsView( ) { padding -> Column( modifier = Modifier - .padding(padding) - .verticalScroll(rememberScrollState()) - .consumeWindowInsets(padding) + .padding(padding) + .verticalScroll(rememberScrollState()) + .consumeWindowInsets(padding) ) { LeaveRoomView(state = state.leaveRoomState) @@ -273,8 +275,8 @@ private fun MainActionsSection( ) { Row( modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp), + .fillMaxWidth() + .padding(horizontal = 16.dp), horizontalArrangement = Arrangement.SpaceEvenly, ) { val roomNotificationSettings = state.roomNotificationSettings @@ -333,8 +335,8 @@ private fun RoomHeaderSection( ) { Column( modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp), + .fillMaxWidth() + .padding(horizontal = 16.dp), horizontalAlignment = Alignment.CenterHorizontally, ) { CompositeAvatar( @@ -343,8 +345,8 @@ private fun RoomHeaderSection( user.getAvatarData(size = AvatarSize.RoomHeader) }.toPersistentList(), modifier = Modifier - .clickable(enabled = avatarUrl != null) { openAvatarPreview(avatarUrl!!) } - .testTag(TestTags.roomDetailAvatar) + .clickable(enabled = avatarUrl != null) { openAvatarPreview(avatarUrl!!) } + .testTag(TestTags.roomDetailAvatar) ) TitleAndSubtitle(title = roomName, subtitle = roomAlias?.value) } @@ -360,8 +362,8 @@ private fun DmHeaderSection( ) { Column( modifier = modifier - .fillMaxWidth() - .padding(horizontal = 16.dp), + .fillMaxWidth() + .padding(horizontal = 16.dp), horizontalAlignment = Alignment.CenterHorizontally, ) { DmAvatars( @@ -406,32 +408,37 @@ private fun BadgeList( modifier: Modifier = Modifier, ) { if (isEncrypted || isPublic) { - Row( - modifier = modifier - .padding(start = 16.dp, end = 16.dp, top = 8.dp), - horizontalArrangement = Arrangement.spacedBy(8.dp), - ) { - if (isEncrypted) { - MatrixBadgeAtom.View( - text = stringResource(R.string.screen_room_details_badge_encrypted), - icon = CompoundIcons.LockSolid(), - type = MatrixBadgeAtom.Type.Positive, - ) - } else { - MatrixBadgeAtom.View( - text = stringResource(R.string.screen_room_details_badge_not_encrypted), - icon = CompoundIcons.LockOff(), - type = MatrixBadgeAtom.Type.Neutral, - ) - } - if (isPublic) { - MatrixBadgeAtom.View( - text = stringResource(R.string.screen_room_details_badge_public), - icon = CompoundIcons.Public(), - type = MatrixBadgeAtom.Type.Neutral, - ) - } - } + MatrixBadgeRowMolecule( + modifier = modifier, + data = buildList { + if (isEncrypted) { + add( + MatrixBadgeAtom.MatrixBadgeData( + text = stringResource(R.string.screen_room_details_badge_encrypted), + icon = CompoundIcons.LockSolid(), + type = MatrixBadgeAtom.Type.Positive, + ) + ) + } else { + add( + MatrixBadgeAtom.MatrixBadgeData( + text = stringResource(R.string.screen_room_details_badge_not_encrypted), + icon = CompoundIcons.LockOff(), + type = MatrixBadgeAtom.Type.Neutral, + ) + ) + } + if (isPublic) { + add( + MatrixBadgeAtom.MatrixBadgeData( + text = stringResource(R.string.screen_room_details_badge_public), + icon = CompoundIcons.Public(), + type = MatrixBadgeAtom.Type.Neutral, + ) + ) + } + }.toImmutableList(), + ) } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/MatrixBadgeAtom.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/MatrixBadgeAtom.kt index 2e2b4b07fb..a4b438527f 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/MatrixBadgeAtom.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/MatrixBadgeAtom.kt @@ -22,6 +22,12 @@ import io.element.android.libraries.designsystem.theme.badgePositiveBackgroundCo import io.element.android.libraries.designsystem.theme.badgePositiveContentColor object MatrixBadgeAtom { + data class MatrixBadgeData( + val text: String, + val icon: ImageVector, + val type: Type, + ) + enum class Type { Positive, Neutral, @@ -30,28 +36,26 @@ object MatrixBadgeAtom { @Composable fun View( - text: String, - icon: ImageVector, - type: Type, + data: MatrixBadgeData, ) { - val backgroundColor = when (type) { + val backgroundColor = when (data.type) { Type.Positive -> ElementTheme.colors.badgePositiveBackgroundColor Type.Neutral -> ElementTheme.colors.badgeNeutralBackgroundColor Type.Negative -> ElementTheme.colors.badgeNegativeBackgroundColor } - val textColor = when (type) { + val textColor = when (data.type) { Type.Positive -> ElementTheme.colors.badgePositiveContentColor Type.Neutral -> ElementTheme.colors.badgeNeutralContentColor Type.Negative -> ElementTheme.colors.badgeNegativeContentColor } - val iconColor = when (type) { + val iconColor = when (data.type) { Type.Positive -> ElementTheme.colors.iconSuccessPrimary Type.Neutral -> ElementTheme.colors.iconSecondary Type.Negative -> ElementTheme.colors.iconCriticalPrimary } Badge( - text = text, - icon = icon, + text = data.text, + icon = data.icon, backgroundColor = backgroundColor, iconColor = iconColor, textColor = textColor, @@ -63,9 +67,11 @@ object MatrixBadgeAtom { @Composable internal fun MatrixBadgeAtomPositivePreview() = ElementPreview { MatrixBadgeAtom.View( - text = "Trusted", - icon = CompoundIcons.Verified(), - type = MatrixBadgeAtom.Type.Positive, + MatrixBadgeAtom.MatrixBadgeData( + text = "Trusted", + icon = CompoundIcons.Verified(), + type = MatrixBadgeAtom.Type.Positive, + ) ) } @@ -73,9 +79,11 @@ internal fun MatrixBadgeAtomPositivePreview() = ElementPreview { @Composable internal fun MatrixBadgeAtomNeutralPreview() = ElementPreview { MatrixBadgeAtom.View( - text = "Public room", - icon = CompoundIcons.Public(), - type = MatrixBadgeAtom.Type.Neutral, + MatrixBadgeAtom.MatrixBadgeData( + text = "Public room", + icon = CompoundIcons.Public(), + type = MatrixBadgeAtom.Type.Neutral, + ) ) } @@ -83,8 +91,10 @@ internal fun MatrixBadgeAtomNeutralPreview() = ElementPreview { @Composable internal fun MatrixBadgeAtomNegativePreview() = ElementPreview { MatrixBadgeAtom.View( - text = "Not trusted", - icon = CompoundIcons.Error(), - type = MatrixBadgeAtom.Type.Negative, + MatrixBadgeAtom.MatrixBadgeData( + text = "Not trusted", + icon = CompoundIcons.Error(), + type = MatrixBadgeAtom.Type.Negative, + ) ) } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/MatrixBadgeRowMolecule.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/MatrixBadgeRowMolecule.kt new file mode 100644 index 0000000000..f7bb79cf17 --- /dev/null +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/MatrixBadgeRowMolecule.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2024 New Vector Ltd. + * + * SPDX-License-Identifier: AGPL-3.0-only + * Please see LICENSE in the repository root for full details. + */ + +package io.element.android.libraries.designsystem.atomic.molecules + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import io.element.android.libraries.designsystem.atomic.atoms.MatrixBadgeAtom +import kotlinx.collections.immutable.ImmutableList + +@Composable +fun MatrixBadgeRowMolecule( + data: ImmutableList, + modifier: Modifier = Modifier, +) { + Row( + modifier = modifier + .padding(start = 16.dp, end = 16.dp, top = 8.dp), + horizontalArrangement = Arrangement.spacedBy(8.dp), + ) { + for (badge in data) { + MatrixBadgeAtom.View(badge) + } + } +} From ddf4c6de099e3e6a7f12b65ac91060bc685d3dad Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 16 Oct 2024 18:07:08 +0200 Subject: [PATCH 03/13] Remove unnecessary padding, the Column already have a padding. --- .../userprofile/shared/UserProfileHeaderSection.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt index 00a69e9ca3..abbb9ccdbe 100644 --- a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt +++ b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt @@ -48,8 +48,8 @@ fun UserProfileHeaderSection( Avatar( avatarData = AvatarData(userId.value, userName, avatarUrl, AvatarSize.UserHeader), modifier = Modifier - .clickable(enabled = avatarUrl != null) { openAvatarPreview(avatarUrl!!) } - .testTag(TestTags.memberDetailAvatar) + .clickable(enabled = avatarUrl != null) { openAvatarPreview(avatarUrl!!) } + .testTag(TestTags.memberDetailAvatar) ) Spacer(modifier = Modifier.height(24.dp)) if (userName != null) { @@ -65,9 +65,6 @@ fun UserProfileHeaderSection( text = userId.value, style = ElementTheme.typography.fontBodyLgRegular, color = MaterialTheme.colorScheme.secondary, - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp), textAlign = TextAlign.Center, ) Spacer(Modifier.height(40.dp)) From 8efbd67eea6b1620fdbbb14f0ba99570fccf45f7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 18 Oct 2024 12:00:07 +0200 Subject: [PATCH 04/13] Move strings with key starting by `screen_room_member_details_` to the module `:features:userprofile:shared` --- .../shared/src/main/res/values-be/translations.xml | 7 +++++++ .../shared/src/main/res/values-bg/translations.xml | 4 ++++ .../shared/src/main/res/values-cs/translations.xml | 9 +++++++++ .../shared/src/main/res/values-de/translations.xml | 7 +++++++ .../shared/src/main/res/values-el/translations.xml | 7 +++++++ .../shared/src/main/res/values-es/translations.xml | 6 ++++++ .../shared/src/main/res/values-et/translations.xml | 9 +++++++++ .../shared/src/main/res/values-fa/translations.xml | 6 ++++++ .../shared/src/main/res/values-fr/translations.xml | 9 +++++++++ .../shared/src/main/res/values-hu/translations.xml | 9 +++++++++ .../shared/src/main/res/values-it/translations.xml | 7 +++++++ .../shared/src/main/res/values-ka/translations.xml | 6 ++++++ .../shared/src/main/res/values-nl/translations.xml | 7 +++++++ .../shared/src/main/res/values-pl/translations.xml | 7 +++++++ .../shared/src/main/res/values-pt-rBR/translations.xml | 6 ++++++ .../shared/src/main/res/values-pt/translations.xml | 9 +++++++++ .../shared/src/main/res/values-ro/translations.xml | 7 +++++++ .../shared/src/main/res/values-ru/translations.xml | 9 +++++++++ .../shared/src/main/res/values-sk/translations.xml | 7 +++++++ .../shared/src/main/res/values-sv/translations.xml | 7 +++++++ .../shared/src/main/res/values-uk/translations.xml | 7 +++++++ .../shared/src/main/res/values-uz/translations.xml | 6 ++++++ .../shared/src/main/res/values-zh-rTW/translations.xml | 7 +++++++ .../shared/src/main/res/values-zh/translations.xml | 7 +++++++ .../userprofile/shared/src/main/res/values/localazy.xml | 9 +++++++++ .../ui-strings/src/main/res/values-be/translations.xml | 7 ------- .../ui-strings/src/main/res/values-bg/translations.xml | 4 ---- .../ui-strings/src/main/res/values-cs/translations.xml | 9 --------- .../ui-strings/src/main/res/values-de/translations.xml | 7 ------- .../ui-strings/src/main/res/values-el/translations.xml | 7 ------- .../ui-strings/src/main/res/values-es/translations.xml | 6 ------ .../ui-strings/src/main/res/values-et/translations.xml | 9 --------- .../ui-strings/src/main/res/values-fa/translations.xml | 6 ------ .../ui-strings/src/main/res/values-fr/translations.xml | 9 --------- .../ui-strings/src/main/res/values-hu/translations.xml | 9 --------- .../ui-strings/src/main/res/values-in/translations.xml | 7 ------- .../ui-strings/src/main/res/values-it/translations.xml | 7 ------- .../ui-strings/src/main/res/values-ka/translations.xml | 6 ------ .../ui-strings/src/main/res/values-nl/translations.xml | 7 ------- .../ui-strings/src/main/res/values-pl/translations.xml | 7 ------- .../src/main/res/values-pt-rBR/translations.xml | 6 ------ .../ui-strings/src/main/res/values-pt/translations.xml | 9 --------- .../ui-strings/src/main/res/values-ro/translations.xml | 7 ------- .../ui-strings/src/main/res/values-ru/translations.xml | 9 --------- .../ui-strings/src/main/res/values-sk/translations.xml | 7 ------- .../ui-strings/src/main/res/values-sv/translations.xml | 7 ------- .../ui-strings/src/main/res/values-uk/translations.xml | 7 ------- .../ui-strings/src/main/res/values-uz/translations.xml | 6 ------ .../src/main/res/values-zh-rTW/translations.xml | 7 ------- .../ui-strings/src/main/res/values-zh/translations.xml | 7 ------- libraries/ui-strings/src/main/res/values/localazy.xml | 9 --------- tools/localazy/config.json | 3 ++- 52 files changed, 183 insertions(+), 189 deletions(-) diff --git a/features/userprofile/shared/src/main/res/values-be/translations.xml b/features/userprofile/shared/src/main/res/values-be/translations.xml index 3e5b95d74c..6466c3b7bf 100644 --- a/features/userprofile/shared/src/main/res/values-be/translations.xml +++ b/features/userprofile/shared/src/main/res/values-be/translations.xml @@ -6,5 +6,12 @@ "Разблакіраваць" "Вы зноў зможаце ўбачыць усе паведамленні." "Разблакіраваць карыстальніка" + "Заблакіраваць" + "Заблакіраваныя карыстальнікі не змогуць адпраўляць вам паведамленні, і ўсе іх паведамленні будуць схаваны. Вы можаце разблакіраваць іх у любы час." + "Заблакіраваць карыстальніка" + "Профіль" + "Разблакіраваць" + "Вы зноў зможаце ўбачыць усе паведамленні." + "Разблакіраваць карыстальніка" "Пры спробе пачаць чат адбылася памылка" diff --git a/features/userprofile/shared/src/main/res/values-bg/translations.xml b/features/userprofile/shared/src/main/res/values-bg/translations.xml index 96b7bf7f56..67c73e3ea8 100644 --- a/features/userprofile/shared/src/main/res/values-bg/translations.xml +++ b/features/userprofile/shared/src/main/res/values-bg/translations.xml @@ -4,4 +4,8 @@ "Блокиране на потребителя" "Отблокиране" "Отблокиране на потребителя" + "Блокиране" + "Блокиране на потребителя" + "Отблокиране" + "Отблокиране на потребителя" diff --git a/features/userprofile/shared/src/main/res/values-cs/translations.xml b/features/userprofile/shared/src/main/res/values-cs/translations.xml index 541954b8b8..9296f1062f 100644 --- a/features/userprofile/shared/src/main/res/values-cs/translations.xml +++ b/features/userprofile/shared/src/main/res/values-cs/translations.xml @@ -6,5 +6,14 @@ "Odblokovat" "Znovu uvidíte všechny zprávy od nich." "Odblokovat uživatele" + "Zablokovat" + "Blokovaní uživatelé vám nebudou moci posílat zprávy a všechny jejich zprávy budou skryty. Můžete je kdykoli odblokovat." + "Zablokovat uživatele" + "Profil" + "Odblokovat" + "Znovu uvidíte všechny zprávy od nich." + "Odblokovat uživatele" + "K ověření tohoto uživatele použijte webovou aplikaci." + "Ověřit %1$s" "Při pokusu o zahájení chatu došlo k chybě" diff --git a/features/userprofile/shared/src/main/res/values-de/translations.xml b/features/userprofile/shared/src/main/res/values-de/translations.xml index 02f7517401..ff20101939 100644 --- a/features/userprofile/shared/src/main/res/values-de/translations.xml +++ b/features/userprofile/shared/src/main/res/values-de/translations.xml @@ -6,5 +6,12 @@ "Blockierung aufheben" "Der Nutzer kann dir wieder Nachrichten senden & alle Nachrichten des Nutzers werden wieder angezeigt." "Blockierung aufheben" + "Blockieren" + "Blockierte Benutzer können Dir keine Nachrichten senden und alle ihre alten Nachrichten werden ausgeblendet. Die Blockierung kann jederzeit aufgehoben werden." + "Benutzer blockieren" + "Profil" + "Blockierung aufheben" + "Der Nutzer kann dir wieder Nachrichten senden & alle Nachrichten des Nutzers werden wieder angezeigt." + "Blockierung aufheben" "Beim Versuch, einen Chat zu starten, ist ein Fehler aufgetreten" diff --git a/features/userprofile/shared/src/main/res/values-el/translations.xml b/features/userprofile/shared/src/main/res/values-el/translations.xml index 24061384ed..8dfb9fff92 100644 --- a/features/userprofile/shared/src/main/res/values-el/translations.xml +++ b/features/userprofile/shared/src/main/res/values-el/translations.xml @@ -6,5 +6,12 @@ "Άρση αποκλεισμού" "Θα μπορείς να δεις ξανά όλα τα μηνύματα του." "Κατάργηση αποκλεισμού χρήστη" + "Αποκλεισμός" + "Οι αποκλεισμένοι χρήστες δεν θα μπορούν να σου στέλνουν μηνύματα και όλα τα μηνύματά τους θα είναι κρυμμένα. Μπορείς να τα ξεμπλοκάρεις ανά πάσα στιγμή." + "Αποκλεισμός χρήστη" + "Προφίλ" + "Άρση αποκλεισμού" + "Θα μπορείς να δεις ξανά όλα τα μηνύματα του." + "Κατάργηση αποκλεισμού χρήστη" "Παρουσιάστηκε σφάλμα κατά την προσπάθεια έναρξης μιας συνομιλίας" diff --git a/features/userprofile/shared/src/main/res/values-es/translations.xml b/features/userprofile/shared/src/main/res/values-es/translations.xml index ffe33a333a..7d9a03375e 100644 --- a/features/userprofile/shared/src/main/res/values-es/translations.xml +++ b/features/userprofile/shared/src/main/res/values-es/translations.xml @@ -6,5 +6,11 @@ "Desbloquear" "Podrás ver todos sus mensajes de nuevo." "Desbloquear usuario" + "Bloquear" + "Los usuarios bloqueados no podrán enviarte mensajes y todos sus mensajes se ocultarán. Puedes desbloquearlos cuando quieras." + "Bloquear usuario" + "Desbloquear" + "Podrás ver todos sus mensajes de nuevo." + "Desbloquear usuario" "Se ha producido un error al intentar iniciar un chat" diff --git a/features/userprofile/shared/src/main/res/values-et/translations.xml b/features/userprofile/shared/src/main/res/values-et/translations.xml index d34ba97674..ce57e09dd6 100644 --- a/features/userprofile/shared/src/main/res/values-et/translations.xml +++ b/features/userprofile/shared/src/main/res/values-et/translations.xml @@ -6,5 +6,14 @@ "Eemalda blokeering" "Nüüd näed sa jälle kõiki tema sõnumeid" "Eemalda kasutajalt blokeering" + "Blokeeri" + "Blokeeritud kasutajad ei saa sulle kirjutada ja kõik nende sõnumid on sinu eest peidetud. Sa saad alati blokeeringu eemaldada." + "Blokeeri kasutaja" + "Profiil" + "Eemalda blokeering" + "Nüüd näed sa jälle kõiki tema sõnumeid" + "Eemalda kasutajalt blokeering" + "Kasutaja verifitseerimiseks kasuta veebirakendust." + "Verifitseeri kasutaja %1$s" "Vestluse alustamisel tekkis viga" diff --git a/features/userprofile/shared/src/main/res/values-fa/translations.xml b/features/userprofile/shared/src/main/res/values-fa/translations.xml index 169a87c2c3..8ce64548de 100644 --- a/features/userprofile/shared/src/main/res/values-fa/translations.xml +++ b/features/userprofile/shared/src/main/res/values-fa/translations.xml @@ -5,4 +5,10 @@ "رفع انسداد" "قادر خواهید بود دوباره همهٔ پیام‌هایش را ببینید." "رفع انسداد کاربر" + "بلوک" + "انسداد کاربر" + "نمایه" + "رفع انسداد" + "قادر خواهید بود دوباره همهٔ پیام‌هایش را ببینید." + "رفع انسداد کاربر" diff --git a/features/userprofile/shared/src/main/res/values-fr/translations.xml b/features/userprofile/shared/src/main/res/values-fr/translations.xml index 0238cacbc4..e8fae8852f 100644 --- a/features/userprofile/shared/src/main/res/values-fr/translations.xml +++ b/features/userprofile/shared/src/main/res/values-fr/translations.xml @@ -6,5 +6,14 @@ "Débloquer" "Vous pourrez à nouveau voir tous ses messages." "Débloquer l’utilisateur" + "Bloquer" + "Les utilisateurs bloqués ne pourront pas vous envoyer de messages et tous leurs messages seront masqués. Vous pouvez les débloquer à tout moment." + "Bloquer l’utilisateur" + "Profil" + "Débloquer" + "Vous pourrez à nouveau voir tous ses messages." + "Débloquer l’utilisateur" + "Utilisez l’application Web pour vérifier cet utilisateur." + "Vérifier %1$s" "Une erreur s’est produite lors de la tentative de création de la discussion" diff --git a/features/userprofile/shared/src/main/res/values-hu/translations.xml b/features/userprofile/shared/src/main/res/values-hu/translations.xml index 9b491d557b..0a433ee5da 100644 --- a/features/userprofile/shared/src/main/res/values-hu/translations.xml +++ b/features/userprofile/shared/src/main/res/values-hu/translations.xml @@ -6,5 +6,14 @@ "Letiltás feloldása" "Újra láthatja az összes üzenetét." "Felhasználó kitiltásának feloldása" + "Letiltás" + "A letiltott felhasználók nem fognak tudni üzeneteket küldeni, és az összes üzenetük rejtve lesz. Bármikor feloldhatja a letiltásukat." + "Felhasználó letiltása" + "Profil" + "Letiltás feloldása" + "Újra láthatja az összes üzenetét." + "Felhasználó kitiltásának feloldása" + "Használja a webes alkalmazást a felhasználó ellenőrzéséhez." + "A(z) %1$s ellenőrzése" "Hiba történt a csevegés indításakor" diff --git a/features/userprofile/shared/src/main/res/values-it/translations.xml b/features/userprofile/shared/src/main/res/values-it/translations.xml index e123113da6..daacd44255 100644 --- a/features/userprofile/shared/src/main/res/values-it/translations.xml +++ b/features/userprofile/shared/src/main/res/values-it/translations.xml @@ -6,5 +6,12 @@ "Sblocca" "Potrai vedere di nuovo tutti i suoi messaggi." "Sblocca utente" + "Blocca" + "Gli utenti bloccati non saranno in grado di inviarti messaggi e tutti quelli già ricevuti saranno nascosti. Puoi sbloccarli in qualsiasi momento." + "Blocca utente" + "Profilo" + "Sblocca" + "Potrai vedere di nuovo tutti i suoi messaggi." + "Sblocca utente" "Si è verificato un errore durante il tentativo di avviare una chat" diff --git a/features/userprofile/shared/src/main/res/values-ka/translations.xml b/features/userprofile/shared/src/main/res/values-ka/translations.xml index 0054f19946..f0b863e201 100644 --- a/features/userprofile/shared/src/main/res/values-ka/translations.xml +++ b/features/userprofile/shared/src/main/res/values-ka/translations.xml @@ -6,5 +6,11 @@ "განბლოკვა" "თქვენ კვლავ შეძლებთ მათგან ყველა შეტყობინების ნახვას." "Მომხმარებლის განბლოკვა" + "დაბლოკვა" + "დაბლოკილი მომხმარებლები ვერ შეძლებენ თქვენთვის შეტყობინების გაგზავნას და ყველა მათი შეტყობინება თქვენთვის დამალული იქნება. თქვენ მათი განბლოკვა ნებისმეირ დროს შეგიძლიათ." + "მომხმარებლის დაბლოკვა" + "განბლოკვა" + "თქვენ კვლავ შეძლებთ მათგან ყველა შეტყობინების ნახვას." + "Მომხმარებლის განბლოკვა" "ჩატის დაწყების მცდელობისას შეცდომა მოხდა" diff --git a/features/userprofile/shared/src/main/res/values-nl/translations.xml b/features/userprofile/shared/src/main/res/values-nl/translations.xml index ec08bf8650..7acdb58bdb 100644 --- a/features/userprofile/shared/src/main/res/values-nl/translations.xml +++ b/features/userprofile/shared/src/main/res/values-nl/translations.xml @@ -6,5 +6,12 @@ "Deblokkeren" "Je zult alle berichten van hen weer kunnen zien." "Gebruiker deblokkeren" + "Blokkeren" + "Geblokkeerde gebruikers kunnen je geen berichten sturen en al hun berichten worden verborgen. Je kunt ze op elk moment deblokkeren." + "Gebruiker blokkeren" + "Profiel" + "Deblokkeren" + "Je zult alle berichten van hen weer kunnen zien." + "Gebruiker deblokkeren" "Er is een fout opgetreden bij het starten van een chat" diff --git a/features/userprofile/shared/src/main/res/values-pl/translations.xml b/features/userprofile/shared/src/main/res/values-pl/translations.xml index 8ee9d296ac..ebac7599dc 100644 --- a/features/userprofile/shared/src/main/res/values-pl/translations.xml +++ b/features/userprofile/shared/src/main/res/values-pl/translations.xml @@ -6,5 +6,12 @@ "Odblokuj" "Będziesz mógł ponownie zobaczyć wszystkie wiadomości od tego użytkownika." "Odblokuj użytkownika" + "Zablokuj" + "Zablokowani użytkownicy nie będą mogli wysyłać Ci wiadomości, a wszystkie ich wiadomości zostaną ukryte. Możesz odblokować ich w dowolnym momencie." + "Zablokuj użytkownika" + "Profil" + "Odblokuj" + "Będziesz mógł ponownie zobaczyć wszystkie wiadomości od tego użytkownika." + "Odblokuj użytkownika" "Wystąpił błąd podczas próby rozpoczęcia czatu" diff --git a/features/userprofile/shared/src/main/res/values-pt-rBR/translations.xml b/features/userprofile/shared/src/main/res/values-pt-rBR/translations.xml index d5a26a77ca..8d64033f62 100644 --- a/features/userprofile/shared/src/main/res/values-pt-rBR/translations.xml +++ b/features/userprofile/shared/src/main/res/values-pt-rBR/translations.xml @@ -6,5 +6,11 @@ "Desbloquear" "Você poderá ver todas as mensagens deles novamente." "Desbloquear usuário" + "Bloquear" + "Usuários bloqueados não poderão enviar mensagens para você e todas as mensagens deles serão ocultadas. Você pode desbloqueá-los a qualquer momento." + "Bloquear usuário" + "Desbloquear" + "Você poderá ver todas as mensagens deles novamente." + "Desbloquear usuário" "Ocorreu um erro ao tentar iniciar um chat" diff --git a/features/userprofile/shared/src/main/res/values-pt/translations.xml b/features/userprofile/shared/src/main/res/values-pt/translations.xml index df2ca21681..eae68be0b7 100644 --- a/features/userprofile/shared/src/main/res/values-pt/translations.xml +++ b/features/userprofile/shared/src/main/res/values-pt/translations.xml @@ -6,5 +6,14 @@ "Desbloquear" "Poderás voltar a ver todas as suas mensagens." "Desbloquear utilizador" + "Bloquear" + "Os utilizadores bloqueados não poderão enviar-te mensagens e todas as suas mensagens ficarão ocultas. Podes desbloqueá-los em qualquer altura." + "Bloquear utilizador" + "Perfil" + "Desbloquear" + "Poderás voltar a ver todas as suas mensagens." + "Desbloquear utilizador" + "Utiliza a aplicação Web para verificar este utilizador." + "Verifique %1$s" "Ocorreu um erro ao tentar iniciar uma conversa" diff --git a/features/userprofile/shared/src/main/res/values-ro/translations.xml b/features/userprofile/shared/src/main/res/values-ro/translations.xml index 0922bbebd6..e5f5f776db 100644 --- a/features/userprofile/shared/src/main/res/values-ro/translations.xml +++ b/features/userprofile/shared/src/main/res/values-ro/translations.xml @@ -6,5 +6,12 @@ "Deblocați" "La deblocarea utilizatorului, veți putea vedea din nou toate mesajele de la acesta." "Deblocați utilizatorul" + "Blocați" + "Utilizatorii blocați nu vă vor putea trimite mesaje și toate mesajele lor vor fi ascunse. Puteți anula această acțiune oricând." + "Blocați utilizatorul" + "Profil" + "Deblocați" + "La deblocarea utilizatorului, veți putea vedea din nou toate mesajele de la acesta." + "Deblocați utilizatorul" "A apărut o eroare la încercarea începerii conversației" diff --git a/features/userprofile/shared/src/main/res/values-ru/translations.xml b/features/userprofile/shared/src/main/res/values-ru/translations.xml index b790f579f1..4138f6471b 100644 --- a/features/userprofile/shared/src/main/res/values-ru/translations.xml +++ b/features/userprofile/shared/src/main/res/values-ru/translations.xml @@ -6,5 +6,14 @@ "Разблокировать" "Вы снова сможете увидеть все сообщения." "Разблокировать пользователя" + "Заблокировать" + "Заблокированные пользователи не смогут отправлять вам сообщения, а все их сообщения будут скрыты. Вы можете разблокировать их в любое время." + "Заблокировать пользователя" + "Профиль" + "Разблокировать" + "Вы снова сможете увидеть все сообщения." + "Разблокировать пользователя" + "Используйте веб-приложение для проверки этого пользователя." + "Верифицировать %1$s" "Произошла ошибка при запуске чата" diff --git a/features/userprofile/shared/src/main/res/values-sk/translations.xml b/features/userprofile/shared/src/main/res/values-sk/translations.xml index 01c2dffa42..4055bcd27d 100644 --- a/features/userprofile/shared/src/main/res/values-sk/translations.xml +++ b/features/userprofile/shared/src/main/res/values-sk/translations.xml @@ -6,5 +6,12 @@ "Odblokovať" "Všetky správy od nich budete môcť opäť vidieť." "Odblokovať používateľa" + "Zablokovať" + "Blokovaní používatelia vám nebudú môcť posielať správy a všetky ich správy budú skryté. Môžete ich kedykoľvek odblokovať." + "Zablokovať používateľa" + "Profil" + "Odblokovať" + "Všetky správy od nich budete môcť opäť vidieť." + "Odblokovať používateľa" "Pri pokuse o spustenie konverzácie sa vyskytla chyba" diff --git a/features/userprofile/shared/src/main/res/values-sv/translations.xml b/features/userprofile/shared/src/main/res/values-sv/translations.xml index 6f2c9568c1..a1afe5398f 100644 --- a/features/userprofile/shared/src/main/res/values-sv/translations.xml +++ b/features/userprofile/shared/src/main/res/values-sv/translations.xml @@ -6,5 +6,12 @@ "Avblockera" "Du kommer att kunna se alla meddelanden från dem igen." "Avblockera användare" + "Blockera" + "Blockerade användare kommer inte att kunna skicka meddelanden till dig och alla deras meddelanden kommer att döljas. Du kan avblockera dem när som helst." + "Blockera användare" + "Profil" + "Avblockera" + "Du kommer att kunna se alla meddelanden från dem igen." + "Avblockera användare" "Ett fel uppstod när du försökte starta en chatt" diff --git a/features/userprofile/shared/src/main/res/values-uk/translations.xml b/features/userprofile/shared/src/main/res/values-uk/translations.xml index 63bc66bb0f..2caa1d99f0 100644 --- a/features/userprofile/shared/src/main/res/values-uk/translations.xml +++ b/features/userprofile/shared/src/main/res/values-uk/translations.xml @@ -6,5 +6,12 @@ "Розблокувати" "Ви знову зможете бачити всі повідомлення від них." "Розблокувати користувача" + "Заблокувати" + "Заблоковані користувачі не зможуть надсилати Вам повідомлення, і всі їхні повідомлення будуть приховані. Ви можете розблокувати їх у будь-який час." + "Заблокувати користувача" + "Профіль" + "Розблокувати" + "Ви знову зможете бачити всі повідомлення від них." + "Розблокувати користувача" "Під час спроби почати чат сталася помилка" diff --git a/features/userprofile/shared/src/main/res/values-uz/translations.xml b/features/userprofile/shared/src/main/res/values-uz/translations.xml index 5c7e50eaec..4e4fe08051 100644 --- a/features/userprofile/shared/src/main/res/values-uz/translations.xml +++ b/features/userprofile/shared/src/main/res/values-uz/translations.xml @@ -6,5 +6,11 @@ "Blokdan chiqarish" "Ulardan kelgan barcha xabarlarni yana koʻrishingiz mumkin boʻladi." "Foydalanuvchini blokdan chiqarish" + "Bloklash" + "Bloklangan foydalanuvchilar sizga xabar yubora olmaydi va ularning barcha xabarlari yashiriladi. Ularni istalgan vaqtda blokdan chiqarishingiz mumkin." + "Foydalanuvchini bloklash" + "Blokdan chiqarish" + "Ulardan kelgan barcha xabarlarni yana koʻrishingiz mumkin boʻladi." + "Foydalanuvchini blokdan chiqarish" "Suhbatni boshlashda xatolik yuz berdi" diff --git a/features/userprofile/shared/src/main/res/values-zh-rTW/translations.xml b/features/userprofile/shared/src/main/res/values-zh-rTW/translations.xml index ec239ebbd5..addc846a5e 100644 --- a/features/userprofile/shared/src/main/res/values-zh-rTW/translations.xml +++ b/features/userprofile/shared/src/main/res/values-zh-rTW/translations.xml @@ -6,4 +6,11 @@ "解除封鎖" "您將無法看到任何來自他們的訊息。" "解除封鎖使用者" + "封鎖" + "被封鎖的使用者無法傳訊息給您,他們的訊息會被隱藏。您可以在任何時候解除封鎖。" + "封鎖使用者" + "個人檔案" + "解除封鎖" + "您將無法看到任何來自他們的訊息。" + "解除封鎖使用者" diff --git a/features/userprofile/shared/src/main/res/values-zh/translations.xml b/features/userprofile/shared/src/main/res/values-zh/translations.xml index 83f884cecb..dd3df4c2cc 100644 --- a/features/userprofile/shared/src/main/res/values-zh/translations.xml +++ b/features/userprofile/shared/src/main/res/values-zh/translations.xml @@ -6,5 +6,12 @@ "解封" "可以重新接收他们的消息。" "解封用户" + "封禁" + "被封禁的用户无法给你发消息,并且他们的消息会被隐藏。你可以随时解封。" + "封禁用户" + "个人资料" + "解封" + "可以重新接收他们的消息。" + "解封用户" "在开始聊天时发生了错误" diff --git a/features/userprofile/shared/src/main/res/values/localazy.xml b/features/userprofile/shared/src/main/res/values/localazy.xml index e73c16fe4e..29f6169f16 100644 --- a/features/userprofile/shared/src/main/res/values/localazy.xml +++ b/features/userprofile/shared/src/main/res/values/localazy.xml @@ -6,5 +6,14 @@ "Unblock" "You\'ll be able to see all messages from them again." "Unblock user" + "Block" + "Blocked users won\'t be able to send you messages and all their messages will be hidden. You can unblock them anytime." + "Block user" + "Profile" + "Unblock" + "You\'ll be able to see all messages from them again." + "Unblock user" + "Use the web app to verify this user." + "Verify %1$s" "An error occurred when trying to start a chat" diff --git a/libraries/ui-strings/src/main/res/values-be/translations.xml b/libraries/ui-strings/src/main/res/values-be/translations.xml index 10b64deda4..52272f43e3 100644 --- a/libraries/ui-strings/src/main/res/values-be/translations.xml +++ b/libraries/ui-strings/src/main/res/values-be/translations.xml @@ -303,13 +303,6 @@ "Замацаваныя паведамленні" "Не атрымалася апрацаваць медыяфайл для загрузкі, паспрабуйце яшчэ раз." "Не ўдалося атрымаць інфармацыю пра карыстальніка" - "Заблакіраваць" - "Заблакіраваныя карыстальнікі не змогуць адпраўляць вам паведамленні, і ўсе іх паведамленні будуць схаваны. Вы можаце разблакіраваць іх у любы час." - "Заблакіраваць карыстальніка" - "Профіль" - "Разблакіраваць" - "Вы зноў зможаце ўбачыць усе паведамленні." - "Разблакіраваць карыстальніка" "%1$s з %2$s" "%1$s Замацаваныя паведамленні" "Загрузка паведамлення…" diff --git a/libraries/ui-strings/src/main/res/values-bg/translations.xml b/libraries/ui-strings/src/main/res/values-bg/translations.xml index 48c602706b..dbe0fa17dc 100644 --- a/libraries/ui-strings/src/main/res/values-bg/translations.xml +++ b/libraries/ui-strings/src/main/res/values-bg/translations.xml @@ -198,10 +198,6 @@ "🔐️ Присъединете се към мен в %1$s" "Хей, говорете с мен в %1$s: %2$s" "%1$s Android" - "Блокиране" - "Блокиране на потребителя" - "Отблокиране" - "Отблокиране на потребителя" "Споделяне на местоположение" "Споделяне на моето местоположение" "Отваряне в Apple Maps" diff --git a/libraries/ui-strings/src/main/res/values-cs/translations.xml b/libraries/ui-strings/src/main/res/values-cs/translations.xml index 8f0a20bd47..d505937781 100644 --- a/libraries/ui-strings/src/main/res/values-cs/translations.xml +++ b/libraries/ui-strings/src/main/res/values-cs/translations.xml @@ -326,15 +326,6 @@ Důvod: %1$s." "Připnuté zprávy" "Nahrání média se nezdařilo, zkuste to prosím znovu." "Nepodařilo se načíst údaje o uživateli" - "Zablokovat" - "Blokovaní uživatelé vám nebudou moci posílat zprávy a všechny jejich zprávy budou skryty. Můžete je kdykoli odblokovat." - "Zablokovat uživatele" - "Profil" - "Odblokovat" - "Znovu uvidíte všechny zprávy od nich." - "Odblokovat uživatele" - "K ověření tohoto uživatele použijte webovou aplikaci." - "Ověřit %1$s" "%1$s z %2$s" "%1$s Připnuté zprávy" "Načítání zprávy…" diff --git a/libraries/ui-strings/src/main/res/values-de/translations.xml b/libraries/ui-strings/src/main/res/values-de/translations.xml index 45696e6f18..06c39e1d6c 100644 --- a/libraries/ui-strings/src/main/res/values-de/translations.xml +++ b/libraries/ui-strings/src/main/res/values-de/translations.xml @@ -294,13 +294,6 @@ Grund: %1$s." "Fixierte Nachrichten" "Fehler beim Verarbeiten des hochgeladenen Mediums. Bitte versuche es erneut." "Benutzerdetails konnten nicht abgerufen werden" - "Blockieren" - "Blockierte Benutzer können Dir keine Nachrichten senden und alle ihre alten Nachrichten werden ausgeblendet. Die Blockierung kann jederzeit aufgehoben werden." - "Benutzer blockieren" - "Profil" - "Blockierung aufheben" - "Der Nutzer kann dir wieder Nachrichten senden & alle Nachrichten des Nutzers werden wieder angezeigt." - "Blockierung aufheben" "%1$s von %2$s" "%1$s fixierte Nachrichten" "Nachricht wird geladen…" diff --git a/libraries/ui-strings/src/main/res/values-el/translations.xml b/libraries/ui-strings/src/main/res/values-el/translations.xml index 482e4b3eb7..82737f373e 100644 --- a/libraries/ui-strings/src/main/res/values-el/translations.xml +++ b/libraries/ui-strings/src/main/res/values-el/translations.xml @@ -312,13 +312,6 @@ "Καρφιτσωμένα μηνύματα" "Αποτυχία μεταφόρτωσης μέσου, δοκίμασε ξανά." "Δεν ήταν δυνατή η ανάκτηση στοιχείων χρήστη" - "Αποκλεισμός" - "Οι αποκλεισμένοι χρήστες δεν θα μπορούν να σου στέλνουν μηνύματα και όλα τα μηνύματά τους θα είναι κρυμμένα. Μπορείς να τα ξεμπλοκάρεις ανά πάσα στιγμή." - "Αποκλεισμός χρήστη" - "Προφίλ" - "Άρση αποκλεισμού" - "Θα μπορείς να δεις ξανά όλα τα μηνύματα του." - "Κατάργηση αποκλεισμού χρήστη" "%1$s από %2$s" "%1$s Καρφιτσωμένα μηνύματα" "Φόρτωση μηνύματος…" diff --git a/libraries/ui-strings/src/main/res/values-es/translations.xml b/libraries/ui-strings/src/main/res/values-es/translations.xml index 4a09b3d52d..ad40a215a7 100644 --- a/libraries/ui-strings/src/main/res/values-es/translations.xml +++ b/libraries/ui-strings/src/main/res/values-es/translations.xml @@ -250,12 +250,6 @@ "Error al subir el contenido multimedia, por favor inténtalo de nuevo." "Error al procesar el contenido multimedia, por favor inténtalo de nuevo." "No se pudieron recuperar los detalles del usuario" - "Bloquear" - "Los usuarios bloqueados no podrán enviarte mensajes y todos sus mensajes se ocultarán. Puedes desbloquearlos cuando quieras." - "Bloquear usuario" - "Desbloquear" - "Podrás ver todos sus mensajes de nuevo." - "Desbloquear usuario" "Compartir ubicación" "Compartir mi ubicación" "Abrir en Apple Maps" diff --git a/libraries/ui-strings/src/main/res/values-et/translations.xml b/libraries/ui-strings/src/main/res/values-et/translations.xml index 5905e40b12..2f23722932 100644 --- a/libraries/ui-strings/src/main/res/values-et/translations.xml +++ b/libraries/ui-strings/src/main/res/values-et/translations.xml @@ -321,15 +321,6 @@ Põhjus: %1$s." "Esiletõstetud sõnumid" "Meediafaili töötlemine enne üleslaadimist ei õnnestunud. Palun proovi uuesti." "Kasutaja andmete laadimine ei õnnestunud" - "Blokeeri" - "Blokeeritud kasutajad ei saa sulle kirjutada ja kõik nende sõnumid on sinu eest peidetud. Sa saad alati blokeeringu eemaldada." - "Blokeeri kasutaja" - "Profiil" - "Eemalda blokeering" - "Nüüd näed sa jälle kõiki tema sõnumeid" - "Eemalda kasutajalt blokeering" - "Kasutaja verifitseerimiseks kasuta veebirakendust." - "Verifitseeri kasutaja %1$s" "%1$s / %2$s" "%1$s esiletõstetud sõnumit" "Laadime sõnumit…" diff --git a/libraries/ui-strings/src/main/res/values-fa/translations.xml b/libraries/ui-strings/src/main/res/values-fa/translations.xml index a22be0888c..ff17ab411b 100644 --- a/libraries/ui-strings/src/main/res/values-fa/translations.xml +++ b/libraries/ui-strings/src/main/res/values-fa/translations.xml @@ -262,12 +262,6 @@ "فرستادن پیام به هر روی" "پیام‌های سنجاق شده" "پردازش رسانه برای بارگذاری شکست خورد. لطفاً دوباره تلاش کنید." - "بلوک" - "انسداد کاربر" - "نمایه" - "رفع انسداد" - "قادر خواهید بود دوباره همهٔ پیام‌هایش را ببینید." - "رفع انسداد کاربر" "%1$s از %2$s" "%1$s پیام‌های سنجاق شده" "بار کردن پشام‌ها…" diff --git a/libraries/ui-strings/src/main/res/values-fr/translations.xml b/libraries/ui-strings/src/main/res/values-fr/translations.xml index a1b8f54f34..1c130c5ffb 100644 --- a/libraries/ui-strings/src/main/res/values-fr/translations.xml +++ b/libraries/ui-strings/src/main/res/values-fr/translations.xml @@ -317,15 +317,6 @@ Raison: %1$s." "Messages épinglés" "Échec du traitement des médias à télécharger, veuillez réessayer." "Impossible de récupérer les détails de l’utilisateur" - "Bloquer" - "Les utilisateurs bloqués ne pourront pas vous envoyer de messages et tous leurs messages seront masqués. Vous pouvez les débloquer à tout moment." - "Bloquer l’utilisateur" - "Profil" - "Débloquer" - "Vous pourrez à nouveau voir tous ses messages." - "Débloquer l’utilisateur" - "Utilisez l’application Web pour vérifier cet utilisateur." - "Vérifier %1$s" "%1$s sur %2$s" "%1$s Messages épinglés" "Chargement du message…" diff --git a/libraries/ui-strings/src/main/res/values-hu/translations.xml b/libraries/ui-strings/src/main/res/values-hu/translations.xml index 6e2d70e004..81dade610a 100644 --- a/libraries/ui-strings/src/main/res/values-hu/translations.xml +++ b/libraries/ui-strings/src/main/res/values-hu/translations.xml @@ -321,15 +321,6 @@ Ok: %1$s." "Kitűzött üzenetek" "Nem sikerült feldolgozni a feltöltendő médiát, próbálja újra." "Nem sikerült letölteni a felhasználói adatokat" - "Letiltás" - "A letiltott felhasználók nem fognak tudni üzeneteket küldeni, és az összes üzenetük rejtve lesz. Bármikor feloldhatja a letiltásukat." - "Felhasználó letiltása" - "Profil" - "Letiltás feloldása" - "Újra láthatja az összes üzenetét." - "Felhasználó kitiltásának feloldása" - "Használja a webes alkalmazást a felhasználó ellenőrzéséhez." - "A(z) %1$s ellenőrzése" "%1$s / %2$s" "%1$s kitűzött üzenet" "Üzenet betöltése…" diff --git a/libraries/ui-strings/src/main/res/values-in/translations.xml b/libraries/ui-strings/src/main/res/values-in/translations.xml index b18cd28116..eefb2206ff 100644 --- a/libraries/ui-strings/src/main/res/values-in/translations.xml +++ b/libraries/ui-strings/src/main/res/values-in/translations.xml @@ -260,13 +260,6 @@ Alasan: %1$s." "Gagal mengunggah media, silakan coba lagi." "Gagal memproses media untuk diunggah, silakan coba lagi." "Tidak dapat mengambil detail pengguna" - "Blokir" - "Pengguna yang diblokir tidak akan dapat mengirim Anda pesan dan semua pesan mereka akan disembunyikan. Anda dapat membuka blokirnya kapan saja." - "Blokir pengguna" - "Profil" - "Buka blokir" - "Anda akan dapat melihat semua pesan dari mereka lagi." - "Buka blokir pengguna" "Obrolan" "Bagikan lokasi" "Bagikan lokasi saya" diff --git a/libraries/ui-strings/src/main/res/values-it/translations.xml b/libraries/ui-strings/src/main/res/values-it/translations.xml index e4e3c79e0e..dd6b3c47de 100644 --- a/libraries/ui-strings/src/main/res/values-it/translations.xml +++ b/libraries/ui-strings/src/main/res/values-it/translations.xml @@ -302,13 +302,6 @@ Motivo:. %1$s" "Messaggi fissati" "Elaborazione del file multimediale da caricare fallita, riprova." "Impossibile recuperare i dettagli dell\'utente" - "Blocca" - "Gli utenti bloccati non saranno in grado di inviarti messaggi e tutti quelli già ricevuti saranno nascosti. Puoi sbloccarli in qualsiasi momento." - "Blocca utente" - "Profilo" - "Sblocca" - "Potrai vedere di nuovo tutti i suoi messaggi." - "Sblocca utente" "%1$s di %2$s" "%1$s Messaggi fissati" "Caricamento messaggio…" diff --git a/libraries/ui-strings/src/main/res/values-ka/translations.xml b/libraries/ui-strings/src/main/res/values-ka/translations.xml index 2661db369a..0df6e83bef 100644 --- a/libraries/ui-strings/src/main/res/values-ka/translations.xml +++ b/libraries/ui-strings/src/main/res/values-ka/translations.xml @@ -238,12 +238,6 @@ "მედიის ატვირთვა ვერ მოხერხდა, გთხოვთ, სცადოთ ხელახლა." "მედიის ატვირთვა ვერ მოხერხდა. გთხოვთ, სცადოთ ხელახლა." "მომხმარებლის მონაცემების მოძიება ვერ მოხერხდა" - "დაბლოკვა" - "დაბლოკილი მომხმარებლები ვერ შეძლებენ თქვენთვის შეტყობინების გაგზავნას და ყველა მათი შეტყობინება თქვენთვის დამალული იქნება. თქვენ მათი განბლოკვა ნებისმეირ დროს შეგიძლიათ." - "მომხმარებლის დაბლოკვა" - "განბლოკვა" - "თქვენ კვლავ შეძლებთ მათგან ყველა შეტყობინების ნახვას." - "Მომხმარებლის განბლოკვა" "მდებარეობის გაზიარება" "ჩემი მდებარეობის გაზიარება" "Apple Maps-ში გახსნა" diff --git a/libraries/ui-strings/src/main/res/values-nl/translations.xml b/libraries/ui-strings/src/main/res/values-nl/translations.xml index d33c05cfc3..d6c7d640b5 100644 --- a/libraries/ui-strings/src/main/res/values-nl/translations.xml +++ b/libraries/ui-strings/src/main/res/values-nl/translations.xml @@ -260,13 +260,6 @@ "Het uploaden van media is mislukt. Probeer het opnieuw." "Het verwerken van media voor uploaden is mislukt. Probeer het opnieuw." "Kon gebruikersgegevens niet ophalen" - "Blokkeren" - "Geblokkeerde gebruikers kunnen je geen berichten sturen en al hun berichten worden verborgen. Je kunt ze op elk moment deblokkeren." - "Gebruiker blokkeren" - "Profiel" - "Deblokkeren" - "Je zult alle berichten van hen weer kunnen zien." - "Gebruiker deblokkeren" "Chat" "Locatie delen" "Deel mijn locatie" diff --git a/libraries/ui-strings/src/main/res/values-pl/translations.xml b/libraries/ui-strings/src/main/res/values-pl/translations.xml index 7d549b905d..c4d7684591 100644 --- a/libraries/ui-strings/src/main/res/values-pl/translations.xml +++ b/libraries/ui-strings/src/main/res/values-pl/translations.xml @@ -307,13 +307,6 @@ Powód: %1$s." "Przypięte wiadomości" "Przetwarzanie multimediów do przesłania nie powiodło się, spróbuj ponownie." "Nie można pobrać danych użytkownika" - "Zablokuj" - "Zablokowani użytkownicy nie będą mogli wysyłać Ci wiadomości, a wszystkie ich wiadomości zostaną ukryte. Możesz odblokować ich w dowolnym momencie." - "Zablokuj użytkownika" - "Profil" - "Odblokuj" - "Będziesz mógł ponownie zobaczyć wszystkie wiadomości od tego użytkownika." - "Odblokuj użytkownika" "%1$s z %2$s" "%1$s przypiętych wiadomości" "Wczytywanie wiadomości…" diff --git a/libraries/ui-strings/src/main/res/values-pt-rBR/translations.xml b/libraries/ui-strings/src/main/res/values-pt-rBR/translations.xml index 17bfd31dc0..f2b246b3b6 100644 --- a/libraries/ui-strings/src/main/res/values-pt-rBR/translations.xml +++ b/libraries/ui-strings/src/main/res/values-pt-rBR/translations.xml @@ -266,12 +266,6 @@ "Falha ao enviar mídia. Tente novamente." "Falha ao processar mídia para upload. Tente novamente." "Não foi possível recuperar os detalhes do usuário" - "Bloquear" - "Usuários bloqueados não poderão enviar mensagens para você e todas as mensagens deles serão ocultadas. Você pode desbloqueá-los a qualquer momento." - "Bloquear usuário" - "Desbloquear" - "Você poderá ver todas as mensagens deles novamente." - "Desbloquear usuário" "Compartilhar localização" "Compartilhar minha localização" "Abrir no Apple Maps" diff --git a/libraries/ui-strings/src/main/res/values-pt/translations.xml b/libraries/ui-strings/src/main/res/values-pt/translations.xml index 14504d056c..121a5f56c3 100644 --- a/libraries/ui-strings/src/main/res/values-pt/translations.xml +++ b/libraries/ui-strings/src/main/res/values-pt/translations.xml @@ -317,15 +317,6 @@ Razão: %1$s." "Mensagens afixadas" "Falha ao processar multimédia para carregamento, por favor tente novamente." "Não foi possível obter os detalhes de utilizador." - "Bloquear" - "Os utilizadores bloqueados não poderão enviar-te mensagens e todas as suas mensagens ficarão ocultas. Podes desbloqueá-los em qualquer altura." - "Bloquear utilizador" - "Perfil" - "Desbloquear" - "Poderás voltar a ver todas as suas mensagens." - "Desbloquear utilizador" - "Utiliza a aplicação Web para verificar este utilizador." - "Verifique %1$s" "%1$s de %2$s" "%1$s mensagens afixadas" "A carregar mensagem…" diff --git a/libraries/ui-strings/src/main/res/values-ro/translations.xml b/libraries/ui-strings/src/main/res/values-ro/translations.xml index 53cc7c3416..51bbf0eaf9 100644 --- a/libraries/ui-strings/src/main/res/values-ro/translations.xml +++ b/libraries/ui-strings/src/main/res/values-ro/translations.xml @@ -264,13 +264,6 @@ "Încărcarea fișierelor media a eșuat, încercați din nou." "Procesarea datelor media a eșuat, vă rugăm să încercați din nou." "Nu am putut găsi detaliile utilizatorului" - "Blocați" - "Utilizatorii blocați nu vă vor putea trimite mesaje și toate mesajele lor vor fi ascunse. Puteți anula această acțiune oricând." - "Blocați utilizatorul" - "Profil" - "Deblocați" - "La deblocarea utilizatorului, veți putea vedea din nou toate mesajele de la acesta." - "Deblocați utilizatorul" "Chat" "Partajați locația" "Distribuiți locația mea" diff --git a/libraries/ui-strings/src/main/res/values-ru/translations.xml b/libraries/ui-strings/src/main/res/values-ru/translations.xml index 866e210cf1..4628cbf0b3 100644 --- a/libraries/ui-strings/src/main/res/values-ru/translations.xml +++ b/libraries/ui-strings/src/main/res/values-ru/translations.xml @@ -328,15 +328,6 @@ "Закрепленные сообщения" "Не удалось обработать медиафайл для загрузки, попробуйте еще раз." "Не удалось получить данные о пользователе" - "Заблокировать" - "Заблокированные пользователи не смогут отправлять вам сообщения, а все их сообщения будут скрыты. Вы можете разблокировать их в любое время." - "Заблокировать пользователя" - "Профиль" - "Разблокировать" - "Вы снова сможете увидеть все сообщения." - "Разблокировать пользователя" - "Используйте веб-приложение для проверки этого пользователя." - "Верифицировать %1$s" "%1$s из %2$s" "%1$s Закрепленные сообщения" "Загрузка сообщения…" diff --git a/libraries/ui-strings/src/main/res/values-sk/translations.xml b/libraries/ui-strings/src/main/res/values-sk/translations.xml index c121d8bf6d..665a23b421 100644 --- a/libraries/ui-strings/src/main/res/values-sk/translations.xml +++ b/libraries/ui-strings/src/main/res/values-sk/translations.xml @@ -308,13 +308,6 @@ Dôvod: %1$s." "Pripnuté správy" "Nepodarilo sa spracovať médiá na odoslanie, skúste to prosím znova." "Nepodarilo sa získať údaje o používateľovi" - "Zablokovať" - "Blokovaní používatelia vám nebudú môcť posielať správy a všetky ich správy budú skryté. Môžete ich kedykoľvek odblokovať." - "Zablokovať používateľa" - "Profil" - "Odblokovať" - "Všetky správy od nich budete môcť opäť vidieť." - "Odblokovať používateľa" "%1$s z %2$s" "%1$s Pripnutých správ" "Načítava sa správa…" diff --git a/libraries/ui-strings/src/main/res/values-sv/translations.xml b/libraries/ui-strings/src/main/res/values-sv/translations.xml index 9a73ec274f..cc203a5183 100644 --- a/libraries/ui-strings/src/main/res/values-sv/translations.xml +++ b/libraries/ui-strings/src/main/res/values-sv/translations.xml @@ -286,13 +286,6 @@ Anledning:%1$s." "Fästa meddelanden" "Misslyckades att bearbeta media för uppladdning, vänligen pröva igen." "Kunde inte hämta användarinformation" - "Blockera" - "Blockerade användare kommer inte att kunna skicka meddelanden till dig och alla deras meddelanden kommer att döljas. Du kan avblockera dem när som helst." - "Blockera användare" - "Profil" - "Avblockera" - "Du kommer att kunna se alla meddelanden från dem igen." - "Avblockera användare" "%1$s av %2$s" "%1$s Fästa meddelanden" "Laddar meddelande …" diff --git a/libraries/ui-strings/src/main/res/values-uk/translations.xml b/libraries/ui-strings/src/main/res/values-uk/translations.xml index d2c1032710..20e3994159 100644 --- a/libraries/ui-strings/src/main/res/values-uk/translations.xml +++ b/libraries/ui-strings/src/main/res/values-uk/translations.xml @@ -276,13 +276,6 @@ "Не вдалося завантажити медіафайл, спробуйте ще раз." "Не вдалося обробити медіафайл для завантаження, спробуйте ще раз." "Не вдалося отримати дані користувача" - "Заблокувати" - "Заблоковані користувачі не зможуть надсилати Вам повідомлення, і всі їхні повідомлення будуть приховані. Ви можете розблокувати їх у будь-який час." - "Заблокувати користувача" - "Профіль" - "Розблокувати" - "Ви знову зможете бачити всі повідомлення від них." - "Розблокувати користувача" "%1$s із %2$s" "%1$s Закріплених повідомлень" "Переглянути всі" diff --git a/libraries/ui-strings/src/main/res/values-uz/translations.xml b/libraries/ui-strings/src/main/res/values-uz/translations.xml index 79571dd613..2f15a5ccd8 100644 --- a/libraries/ui-strings/src/main/res/values-uz/translations.xml +++ b/libraries/ui-strings/src/main/res/values-uz/translations.xml @@ -192,12 +192,6 @@ "Media yuklanmadi, qayta urinib ko‘ring." "Mediani yuklab bo‘lmadi, qayta urinib ko‘ring." "Foydalanuvchi tafsilotlarini olinmadi" - "Bloklash" - "Bloklangan foydalanuvchilar sizga xabar yubora olmaydi va ularning barcha xabarlari yashiriladi. Ularni istalgan vaqtda blokdan chiqarishingiz mumkin." - "Foydalanuvchini bloklash" - "Blokdan chiqarish" - "Ulardan kelgan barcha xabarlarni yana koʻrishingiz mumkin boʻladi." - "Foydalanuvchini blokdan chiqarish" "Joylashuvni ulashish" "Joylashuvimni ulashing" "Apple Mapsda oching" diff --git a/libraries/ui-strings/src/main/res/values-zh-rTW/translations.xml b/libraries/ui-strings/src/main/res/values-zh-rTW/translations.xml index 4480fa1153..63395fffee 100644 --- a/libraries/ui-strings/src/main/res/values-zh-rTW/translations.xml +++ b/libraries/ui-strings/src/main/res/values-zh-rTW/translations.xml @@ -242,13 +242,6 @@ "嘿,來 %1$s 和我聊天:%2$s" "%1$s Android" "無法上傳媒體檔案,請稍後再試。" - "封鎖" - "被封鎖的使用者無法傳訊息給您,他們的訊息會被隱藏。您可以在任何時候解除封鎖。" - "封鎖使用者" - "個人檔案" - "解除封鎖" - "您將無法看到任何來自他們的訊息。" - "解除封鎖使用者" "分享位置" "分享我的位置" "在 Apple Maps 中開啟" diff --git a/libraries/ui-strings/src/main/res/values-zh/translations.xml b/libraries/ui-strings/src/main/res/values-zh/translations.xml index 34bca6d3fa..445f1d4cdd 100644 --- a/libraries/ui-strings/src/main/res/values-zh/translations.xml +++ b/libraries/ui-strings/src/main/res/values-zh/translations.xml @@ -281,13 +281,6 @@ "置顶消息" "处理要上传的媒体失败,请重试。" "无法获取用户信息" - "封禁" - "被封禁的用户无法给你发消息,并且他们的消息会被隐藏。你可以随时解封。" - "封禁用户" - "个人资料" - "解封" - "可以重新接收他们的消息。" - "解封用户" "%1$s / %2$s" "置顶消息 %1$s" "正在加载消息…" diff --git a/libraries/ui-strings/src/main/res/values/localazy.xml b/libraries/ui-strings/src/main/res/values/localazy.xml index f80e8b1a3b..eaea989b4d 100644 --- a/libraries/ui-strings/src/main/res/values/localazy.xml +++ b/libraries/ui-strings/src/main/res/values/localazy.xml @@ -321,15 +321,6 @@ Reason: %1$s." "Pinned messages" "Failed processing media to upload, please try again." "Could not retrieve user details" - "Block" - "Blocked users won\'t be able to send you messages and all their messages will be hidden. You can unblock them anytime." - "Block user" - "Profile" - "Unblock" - "You\'ll be able to see all messages from them again." - "Unblock user" - "Use the web app to verify this user." - "Verify %1$s" "%1$s of %2$s" "%1$s Pinned messages" "Loading message…" diff --git a/tools/localazy/config.json b/tools/localazy/config.json index f7555ea393..f670f08987 100644 --- a/tools/localazy/config.json +++ b/tools/localazy/config.json @@ -176,7 +176,8 @@ "name" : ":features:userprofile:shared", "includeRegex" : [ "screen_start_chat_error_starting_chat", - "screen_dm_details_.*" + "screen_dm_details_.*", + "screen_room_member_details_.*" ] }, { From 5378c4efadddaa4b99acdcc1375c40d61e21a506 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 16 Oct 2024 22:28:16 +0200 Subject: [PATCH 05/13] Verified user badge. Add disable action to verify user. --- .../userprofile/api/UserProfileState.kt | 1 + .../impl/root/UserProfilePresenter.kt | 8 ++++ .../impl/UserProfilePresenterTest.kt | 43 +++++++++++++------ .../shared/UserProfileHeaderSection.kt | 20 +++++++++ .../shared/UserProfileStateProvider.kt | 7 +-- .../userprofile/shared/UserProfileView.kt | 23 ++++++++-- .../userprofile/UserProfileViewTest.kt | 3 ++ .../api/encryption/EncryptionService.kt | 2 + .../impl/encryption/RustEncryptionService.kt | 15 ++++++- .../test/encryption/FakeEncryptionService.kt | 5 +++ 10 files changed, 107 insertions(+), 20 deletions(-) diff --git a/features/userprofile/api/src/main/kotlin/io/element/android/features/userprofile/api/UserProfileState.kt b/features/userprofile/api/src/main/kotlin/io/element/android/features/userprofile/api/UserProfileState.kt index 4bc3dc06d7..128ac5622c 100644 --- a/features/userprofile/api/src/main/kotlin/io/element/android/features/userprofile/api/UserProfileState.kt +++ b/features/userprofile/api/src/main/kotlin/io/element/android/features/userprofile/api/UserProfileState.kt @@ -16,6 +16,7 @@ data class UserProfileState( val userId: UserId, val userName: String?, val avatarUrl: String?, + val isVerified: AsyncData, val isBlocked: AsyncData, val startDmActionState: AsyncAction, val displayConfirmationDialog: ConfirmationDialog?, diff --git a/features/userprofile/impl/src/main/kotlin/io/element/android/features/userprofile/impl/root/UserProfilePresenter.kt b/features/userprofile/impl/src/main/kotlin/io/element/android/features/userprofile/impl/root/UserProfilePresenter.kt index e73eef6aa0..e0fba4ba48 100644 --- a/features/userprofile/impl/src/main/kotlin/io/element/android/features/userprofile/impl/root/UserProfilePresenter.kt +++ b/features/userprofile/impl/src/main/kotlin/io/element/android/features/userprofile/impl/root/UserProfilePresenter.kt @@ -27,6 +27,7 @@ import io.element.android.features.userprofile.api.UserProfileState.Confirmation import io.element.android.libraries.architecture.AsyncAction import io.element.android.libraries.architecture.AsyncData import io.element.android.libraries.architecture.Presenter +import io.element.android.libraries.architecture.runCatchingUpdatingState import io.element.android.libraries.core.bool.orFalse import io.element.android.libraries.matrix.api.MatrixClient import io.element.android.libraries.matrix.api.core.RoomId @@ -75,6 +76,7 @@ class UserProfilePresenter @AssistedInject constructor( var userProfile by remember { mutableStateOf(null) } val startDmActionState: MutableState> = remember { mutableStateOf(AsyncAction.Uninitialized) } val isBlocked: MutableState> = remember { mutableStateOf(AsyncData.Uninitialized) } + val isVerified: MutableState> = remember { mutableStateOf(AsyncData.Uninitialized) } val dmRoomId by getDmRoomId() val canCall by getCanCall(dmRoomId) LaunchedEffect(Unit) { @@ -87,6 +89,11 @@ class UserProfilePresenter @AssistedInject constructor( LaunchedEffect(Unit) { userProfile = client.getProfile(userId).getOrNull() } + LaunchedEffect(Unit) { + suspend { + client.encryptionService().isUserVerified(userId).getOrThrow() + }.runCatchingUpdatingState(isVerified) + } fun handleEvents(event: UserProfileEvents) { when (event) { @@ -126,6 +133,7 @@ class UserProfilePresenter @AssistedInject constructor( userName = userProfile?.displayName, avatarUrl = userProfile?.avatarUrl, isBlocked = isBlocked.value, + isVerified = isVerified.value, startDmActionState = startDmActionState.value, displayConfirmationDialog = confirmationDialog, isCurrentUser = isCurrentUser, diff --git a/features/userprofile/impl/src/test/kotlin/io/element/android/features/userprofile/impl/UserProfilePresenterTest.kt b/features/userprofile/impl/src/test/kotlin/io/element/android/features/userprofile/impl/UserProfilePresenterTest.kt index 1da38187e1..e62555d58f 100644 --- a/features/userprofile/impl/src/test/kotlin/io/element/android/features/userprofile/impl/UserProfilePresenterTest.kt +++ b/features/userprofile/impl/src/test/kotlin/io/element/android/features/userprofile/impl/UserProfilePresenterTest.kt @@ -25,6 +25,7 @@ import io.element.android.libraries.matrix.test.A_THROWABLE import io.element.android.libraries.matrix.test.A_USER_ID import io.element.android.libraries.matrix.test.A_USER_ID_2 import io.element.android.libraries.matrix.test.FakeMatrixClient +import io.element.android.libraries.matrix.test.encryption.FakeEncryptionService import io.element.android.libraries.matrix.test.room.FakeMatrixRoom import io.element.android.libraries.matrix.ui.components.aMatrixUser import io.element.android.tests.testutils.WarmUpRule @@ -43,7 +44,7 @@ class UserProfilePresenterTest { @Test fun `present - returns the user profile data`() = runTest { val matrixUser = aMatrixUser(A_USER_ID.value, "Alice", "anAvatarUrl") - val client = FakeMatrixClient().apply { + val client = createFakeMatrixClient().apply { givenGetProfileResult(A_USER_ID, Result.success(matrixUser)) } val presenter = createUserProfilePresenter( @@ -55,6 +56,7 @@ class UserProfilePresenterTest { assertThat(initialState.userName).isEqualTo(matrixUser.displayName) assertThat(initialState.avatarUrl).isEqualTo(matrixUser.avatarUrl) assertThat(initialState.isBlocked).isEqualTo(AsyncData.Success(false)) + assertThat(initialState.isVerified.dataOrNull()).isFalse() assertThat(initialState.dmRoomId).isEqualTo(A_ROOM_ID) assertThat(initialState.canCall).isFalse() } @@ -108,7 +110,7 @@ class UserProfilePresenterTest { val room = FakeMatrixRoom( canUserJoinCallResult = { canUserJoinCallResult }, ) - val client = FakeMatrixClient().apply { + val client = createFakeMatrixClient().apply { if (canFindRoom) { givenGetRoomResult(A_ROOM_ID, room) } @@ -126,7 +128,7 @@ class UserProfilePresenterTest { @Test fun `present - returns empty data in case of failure`() = runTest { - val client = FakeMatrixClient().apply { + val client = createFakeMatrixClient().apply { givenGetProfileResult(A_USER_ID, Result.failure(AN_EXCEPTION)) } val presenter = createUserProfilePresenter( @@ -153,14 +155,12 @@ class UserProfilePresenterTest { dialogState.eventSink(UserProfileEvents.ClearConfirmationDialog) assertThat(awaitItem().displayConfirmationDialog).isNull() - - ensureAllEventsConsumed() } } @Test fun `present - BlockUser and UnblockUser without confirmation change the 'blocked' state`() = runTest { - val client = FakeMatrixClient() + val client = createFakeMatrixClient() val presenter = createUserProfilePresenter( client = client, userId = A_USER_ID @@ -181,7 +181,7 @@ class UserProfilePresenterTest { @Test fun `present - BlockUser with error`() = runTest { - val matrixClient = FakeMatrixClient() + val matrixClient = createFakeMatrixClient() matrixClient.givenIgnoreUserResult(Result.failure(A_THROWABLE)) val presenter = createUserProfilePresenter(client = matrixClient) presenter.test { @@ -198,7 +198,7 @@ class UserProfilePresenterTest { @Test fun `present - UnblockUser with error`() = runTest { - val matrixClient = FakeMatrixClient() + val matrixClient = createFakeMatrixClient() matrixClient.givenUnignoreUserResult(Result.failure(A_THROWABLE)) val presenter = createUserProfilePresenter(client = matrixClient) presenter.test { @@ -225,8 +225,6 @@ class UserProfilePresenterTest { dialogState.eventSink(UserProfileEvents.ClearConfirmationDialog) assertThat(awaitItem().displayConfirmationDialog).isNull() - - ensureAllEventsConsumed() } } @@ -262,13 +260,34 @@ class UserProfilePresenterTest { } } + @Test + fun `present - when user is verified, the value in the state is true`() = runTest { + val client = createFakeMatrixClient(isUserVerified = true) + val presenter = createUserProfilePresenter( + client = client, + ) + presenter.test { + assertThat(awaitItem().isVerified.isUninitialized()).isTrue() + assertThat(awaitItem().isVerified.isLoading()).isTrue() + assertThat(awaitItem().isVerified.dataOrNull()).isTrue() + } + } + private suspend fun ReceiveTurbine.awaitFirstItem(): T { - skipItems(1) + skipItems(2) return awaitItem() } + private fun createFakeMatrixClient( + isUserVerified: Boolean = false, + ) = FakeMatrixClient( + encryptionService = FakeEncryptionService( + isUserVerifiedResult = { Result.success(isUserVerified) } + ), + ) + private fun createUserProfilePresenter( - client: MatrixClient = FakeMatrixClient(), + client: MatrixClient = createFakeMatrixClient(), userId: UserId = UserId("@alice:server.org"), startDMAction: StartDMAction = FakeStartDMAction() ): UserProfilePresenter { diff --git a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt index abbb9ccdbe..51759d4ae4 100644 --- a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt +++ b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt @@ -18,9 +18,14 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clipToBounds +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import io.element.android.compound.theme.ElementTheme +import io.element.android.compound.tokens.generated.CompoundIcons +import io.element.android.libraries.architecture.AsyncData +import io.element.android.libraries.designsystem.atomic.atoms.MatrixBadgeAtom +import io.element.android.libraries.designsystem.atomic.molecules.MatrixBadgeRowMolecule import io.element.android.libraries.designsystem.components.avatar.Avatar import io.element.android.libraries.designsystem.components.avatar.AvatarData import io.element.android.libraries.designsystem.components.avatar.AvatarSize @@ -30,12 +35,15 @@ import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.matrix.api.core.UserId import io.element.android.libraries.testtags.TestTags import io.element.android.libraries.testtags.testTag +import io.element.android.libraries.ui.strings.CommonStrings +import kotlinx.collections.immutable.toImmutableList @Composable fun UserProfileHeaderSection( avatarUrl: String?, userId: UserId, userName: String?, + isUserVerified: AsyncData, openAvatarPreview: (url: String) -> Unit, modifier: Modifier = Modifier ) { @@ -67,6 +75,17 @@ fun UserProfileHeaderSection( color = MaterialTheme.colorScheme.secondary, textAlign = TextAlign.Center, ) + if (isUserVerified.dataOrNull() == true) { + MatrixBadgeRowMolecule( + data = listOf( + MatrixBadgeAtom.MatrixBadgeData( + text = stringResource(CommonStrings.common_verified), + icon = CompoundIcons.Verified(), + type = MatrixBadgeAtom.Type.Positive, + ) + ).toImmutableList(), + ) + } Spacer(Modifier.height(40.dp)) } } @@ -78,6 +97,7 @@ internal fun UserProfileHeaderSectionPreview() = ElementPreview { avatarUrl = null, userId = UserId("@alice:example.com"), userName = "Alice", + isUserVerified = AsyncData.Success(true), openAvatarPreview = {}, ) } diff --git a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileStateProvider.kt b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileStateProvider.kt index 9fa1eca2dc..e143a4b5f4 100644 --- a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileStateProvider.kt +++ b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileStateProvider.kt @@ -20,13 +20,12 @@ open class UserProfileStateProvider : PreviewParameterProvider get() = sequenceOf( aUserProfileState(), aUserProfileState(userName = null), - aUserProfileState(isBlocked = AsyncData.Success(true)), + aUserProfileState(isBlocked = AsyncData.Success(true), isVerified = AsyncData.Success(true)), aUserProfileState(displayConfirmationDialog = UserProfileState.ConfirmationDialog.Block), aUserProfileState(displayConfirmationDialog = UserProfileState.ConfirmationDialog.Unblock), - aUserProfileState(isBlocked = AsyncData.Loading(true)), + aUserProfileState(isBlocked = AsyncData.Loading(true), isVerified = AsyncData.Loading()), aUserProfileState(startDmActionState = AsyncAction.Loading), aUserProfileState(canCall = true), - aUserProfileState(dmRoomId = null), // Add other states here ) } @@ -36,6 +35,7 @@ fun aUserProfileState( userName: String? = "Daniel", avatarUrl: String? = null, isBlocked: AsyncData = AsyncData.Success(false), + isVerified: AsyncData = AsyncData.Success(false), startDmActionState: AsyncAction = AsyncAction.Uninitialized, displayConfirmationDialog: UserProfileState.ConfirmationDialog? = null, isCurrentUser: Boolean = false, @@ -47,6 +47,7 @@ fun aUserProfileState( userName = userName, avatarUrl = avatarUrl, isBlocked = isBlocked, + isVerified = isVerified, startDmActionState = startDmActionState, displayConfirmationDialog = displayConfirmationDialog, isCurrentUser = isCurrentUser, diff --git a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileView.kt b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileView.kt index 12aafb2731..c87b443d4a 100644 --- a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileView.kt +++ b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileView.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp +import io.element.android.compound.tokens.generated.CompoundIcons import io.element.android.features.userprofile.api.UserProfileEvents import io.element.android.features.userprofile.api.UserProfileState import io.element.android.features.userprofile.shared.blockuser.BlockUserDialogs @@ -28,9 +29,13 @@ import io.element.android.features.userprofile.shared.blockuser.BlockUserSection import io.element.android.libraries.designsystem.components.async.AsyncActionView import io.element.android.libraries.designsystem.components.async.AsyncActionViewDefaults import io.element.android.libraries.designsystem.components.button.BackButton +import io.element.android.libraries.designsystem.components.list.ListItemContent import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.PreviewsDayNight +import io.element.android.libraries.designsystem.theme.components.IconSource +import io.element.android.libraries.designsystem.theme.components.ListItem import io.element.android.libraries.designsystem.theme.components.Scaffold +import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.TopAppBar import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.ui.strings.CommonStrings @@ -63,11 +68,11 @@ fun UserProfileView( avatarUrl = state.avatarUrl, userId = state.userId, userName = state.userName, + isUserVerified = state.isVerified, openAvatarPreview = { avatarUrl -> openAvatarPreview(state.userName ?: state.userId.value, avatarUrl) }, ) - UserProfileMainActionsSection( isCurrentUser = state.isCurrentUser, canCall = state.canCall, @@ -75,10 +80,9 @@ fun UserProfileView( onStartDM = { state.eventSink(UserProfileEvents.StartDM) }, onCall = { state.dmRoomId?.let { onStartCall(it) } } ) - Spacer(modifier = Modifier.height(26.dp)) - if (!state.isCurrentUser) { + VerifyUserSection(state) BlockUserSection(state) BlockUserDialogs(state) } @@ -98,6 +102,19 @@ fun UserProfileView( } } +@Composable +private fun VerifyUserSection(state: UserProfileState) { + if (state.isVerified.dataOrNull() == false) { + ListItem( + headlineContent = { Text(stringResource(R.string.screen_room_member_details_verify_button_title, state.userName ?: state.userId)) }, + supportingContent = { Text(stringResource(R.string.screen_room_member_details_verify_button_subtitle)) }, + leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())), + enabled = false, + onClick = { }, + ) + } +} + @PreviewsDayNight @Composable internal fun UserProfileViewPreview( diff --git a/features/userprofile/shared/src/test/kotlin/io/element/android/features/userprofile/UserProfileViewTest.kt b/features/userprofile/shared/src/test/kotlin/io/element/android/features/userprofile/UserProfileViewTest.kt index 38ebfc7960..6624fb4eba 100644 --- a/features/userprofile/shared/src/test/kotlin/io/element/android/features/userprofile/UserProfileViewTest.kt +++ b/features/userprofile/shared/src/test/kotlin/io/element/android/features/userprofile/UserProfileViewTest.kt @@ -40,6 +40,7 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.TestRule import org.junit.runner.RunWith +import org.robolectric.annotation.Config @RunWith(AndroidJUnit4::class) class UserProfileViewTest { @@ -123,6 +124,7 @@ class UserProfileViewTest { } } + @Config(qualifiers = "h1024dp") @Test fun `on Block user clicked - a BlockUser event is emitted with needsConfirmation`() = runTest { val eventsRecorder = EventsRecorder() @@ -161,6 +163,7 @@ class UserProfileViewTest { eventsRecorder.assertSingle(UserProfileEvents.ClearConfirmationDialog) } + @Config(qualifiers = "h1024dp") @Test fun `on Unblock user clicked - an UnblockUser event is emitted with needsConfirmation`() = runTest { val eventsRecorder = EventsRecorder() diff --git a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/encryption/EncryptionService.kt b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/encryption/EncryptionService.kt index 0bfce8a8d2..b53debcdb2 100644 --- a/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/encryption/EncryptionService.kt +++ b/libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/encryption/EncryptionService.kt @@ -60,6 +60,8 @@ interface EncryptionService { */ suspend fun startIdentityReset(): Result + suspend fun isUserVerified(userId: UserId): Result + /** * Remember this identity, ensuring it does not result in a pin violation. */ diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustEncryptionService.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustEncryptionService.kt index 69dee9a4d4..31dd6b90a1 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustEncryptionService.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustEncryptionService.kt @@ -38,6 +38,7 @@ import org.matrix.rustcomponents.sdk.BackupSteadyStateListener import org.matrix.rustcomponents.sdk.Client import org.matrix.rustcomponents.sdk.EnableRecoveryProgressListener import org.matrix.rustcomponents.sdk.Encryption +import org.matrix.rustcomponents.sdk.UserIdentity import org.matrix.rustcomponents.sdk.BackupUploadState as RustBackupUploadState import org.matrix.rustcomponents.sdk.EnableRecoveryProgress as RustEnableRecoveryProgress import org.matrix.rustcomponents.sdk.SteadyStateException as RustSteadyStateException @@ -204,8 +205,18 @@ internal class RustEncryptionService( } } + override suspend fun isUserVerified(userId: UserId): Result = runCatching { + getUserIdentity(userId).isVerified() + } + override suspend fun pinUserIdentity(userId: UserId): Result = runCatching { - val userIdentity = service.userIdentity(userId.value) ?: error("User identity not found") - userIdentity.pin() + getUserIdentity(userId).pin() + } + + private suspend fun getUserIdentity(userId: UserId): UserIdentity { + return service.userIdentity( + userId = userId.value, + // requestFromHomeserverIfNeeded = true, + ) ?: error("User identity not found") } } diff --git a/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt b/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt index 6778eb5838..5968eda118 100644 --- a/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt +++ b/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt @@ -23,6 +23,7 @@ import kotlinx.coroutines.flow.flowOf class FakeEncryptionService( var startIdentityResetLambda: () -> Result = { lambdaError() }, private val pinUserIdentityResult: (UserId) -> Result = { lambdaError() }, + private val isUserVerifiedResult: (UserId) -> Result = { lambdaError() }, ) : EncryptionService { private var disableRecoveryFailure: Exception? = null override val backupStateStateFlow: MutableStateFlow = MutableStateFlow(BackupState.UNKNOWN) @@ -123,6 +124,10 @@ class FakeEncryptionService( return pinUserIdentityResult(userId) } + override suspend fun isUserVerified(userId: UserId): Result = simulateLongTask { + isUserVerifiedResult(userId) + } + companion object { const val FAKE_RECOVERY_KEY = "fake" } From ecbf6b7e7cedef214d0fe0dae2390d1b4c55c826 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 22 Oct 2024 11:15:46 +0200 Subject: [PATCH 06/13] Room badge: let the presenter compute the list of badges. --- .../roomdetails/impl/RoomDetailsPresenter.kt | 17 +++++ .../roomdetails/impl/RoomDetailsState.kt | 7 ++ .../impl/RoomDetailsStateProvider.kt | 13 ++++ .../roomdetails/impl/RoomDetailsView.kt | 71 +++++++++---------- .../roomdetails/RoomDetailsPresenterTest.kt | 50 ++++++++++++- 5 files changed, 121 insertions(+), 37 deletions(-) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt index eccc8dd9d2..2594fd5509 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt @@ -43,6 +43,7 @@ import io.element.android.libraries.matrix.ui.room.getDirectRoomMember import io.element.android.libraries.matrix.ui.room.isOwnUserAdmin import io.element.android.services.analytics.api.AnalyticsService import io.element.android.services.analyticsproviders.api.trackers.captureInteraction +import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.launchIn @@ -112,6 +113,21 @@ class RoomDetailsPresenter @Inject constructor( val roomNotificationSettingsState by room.roomNotificationSettingsStateFlow.collectAsState() + val roomBadges by produceState(persistentListOf(), isPublic) { + value = buildList { + if (room.isEncrypted || isPublic) { + if (room.isEncrypted) { + add(RoomBadge.ENCRYPTED) + } else { + add(RoomBadge.NOT_ENCRYPTED) + } + } + if (isPublic) { + add(RoomBadge.PUBLIC) + } + }.toPersistentList() + } + fun handleEvents(event: RoomDetailsEvent) { when (event) { RoomDetailsEvent.LeaveRoom -> @@ -151,6 +167,7 @@ class RoomDetailsPresenter @Inject constructor( isFavorite = isFavorite, displayRolesAndPermissionsSettings = !room.isDm && isUserAdmin, isPublic = isPublic, + roomBadges = roomBadges, heroes = roomInfo?.heroes.orEmpty().toPersistentList(), canShowPinnedMessages = canShowPinnedMessages, pinnedMessagesCount = pinnedMessagesCount, diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt index 1abaa59d93..3116f70015 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt @@ -36,6 +36,7 @@ data class RoomDetailsState( val isFavorite: Boolean, val displayRolesAndPermissionsSettings: Boolean, val isPublic: Boolean, + val roomBadges: ImmutableList, val heroes: ImmutableList, val canShowPinnedMessages: Boolean, val pinnedMessagesCount: Int?, @@ -57,3 +58,9 @@ sealed interface RoomTopicState { data object CanAddTopic : RoomTopicState data class ExistingTopic(val topic: String) : RoomTopicState } + +enum class RoomBadge { + ENCRYPTED, + NOT_ENCRYPTED, + PUBLIC; +} diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt index d9b0c22c65..5462bc65a7 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt @@ -96,6 +96,18 @@ fun aRoomDetailsState( isFavorite: Boolean = false, displayAdminSettings: Boolean = false, isPublic: Boolean = true, + roomBadges: List = buildList { + if (isEncrypted || isPublic) { + if (isEncrypted) { + add(RoomBadge.ENCRYPTED) + } else { + add(RoomBadge.NOT_ENCRYPTED) + } + } + if (isPublic) { + add(RoomBadge.PUBLIC) + } + }, heroes: List = emptyList(), canShowPinnedMessages: Boolean = true, pinnedMessagesCount: Int? = null, @@ -119,6 +131,7 @@ fun aRoomDetailsState( isFavorite = isFavorite, displayRolesAndPermissionsSettings = displayAdminSettings, isPublic = isPublic, + roomBadges = roomBadges.toPersistentList(), heroes = heroes.toPersistentList(), canShowPinnedMessages = canShowPinnedMessages, pinnedMessagesCount = pinnedMessagesCount, diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index 8291b3e1c8..b37b23a898 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -147,8 +147,7 @@ fun RoomDetailsView( } } BadgeList( - isEncrypted = state.isEncrypted, - isPublic = state.isPublic, + roomBadge = state.roomBadges, modifier = Modifier.align(Alignment.CenterHorizontally), ) Spacer(Modifier.height(32.dp)) @@ -403,42 +402,42 @@ private fun ColumnScope.TitleAndSubtitle( @Composable private fun BadgeList( - isEncrypted: Boolean, - isPublic: Boolean, + roomBadge: ImmutableList, modifier: Modifier = Modifier, ) { - if (isEncrypted || isPublic) { - MatrixBadgeRowMolecule( - modifier = modifier, - data = buildList { - if (isEncrypted) { - add( - MatrixBadgeAtom.MatrixBadgeData( - text = stringResource(R.string.screen_room_details_badge_encrypted), - icon = CompoundIcons.LockSolid(), - type = MatrixBadgeAtom.Type.Positive, - ) - ) - } else { - add( - MatrixBadgeAtom.MatrixBadgeData( - text = stringResource(R.string.screen_room_details_badge_not_encrypted), - icon = CompoundIcons.LockOff(), - type = MatrixBadgeAtom.Type.Neutral, - ) - ) - } - if (isPublic) { - add( - MatrixBadgeAtom.MatrixBadgeData( - text = stringResource(R.string.screen_room_details_badge_public), - icon = CompoundIcons.Public(), - type = MatrixBadgeAtom.Type.Neutral, - ) - ) - } - }.toImmutableList(), - ) + if (roomBadge.isEmpty()) return + MatrixBadgeRowMolecule( + modifier = modifier, + data = roomBadge.map { + it.toMatrixBadgeData() + }.toImmutableList(), + ) +} + +@Composable +private fun RoomBadge.toMatrixBadgeData(): MatrixBadgeAtom.MatrixBadgeData { + return when (this) { + RoomBadge.ENCRYPTED -> { + MatrixBadgeAtom.MatrixBadgeData( + text = stringResource(R.string.screen_room_details_badge_encrypted), + icon = CompoundIcons.LockSolid(), + type = MatrixBadgeAtom.Type.Positive, + ) + } + RoomBadge.NOT_ENCRYPTED -> { + MatrixBadgeAtom.MatrixBadgeData( + text = stringResource(R.string.screen_room_details_badge_not_encrypted), + icon = CompoundIcons.LockOff(), + type = MatrixBadgeAtom.Type.Neutral, + ) + } + RoomBadge.PUBLIC -> { + MatrixBadgeAtom.MatrixBadgeData( + text = stringResource(R.string.screen_room_details_badge_public), + icon = CompoundIcons.Public(), + type = MatrixBadgeAtom.Type.Neutral, + ) + } } } diff --git a/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/RoomDetailsPresenterTest.kt b/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/RoomDetailsPresenterTest.kt index 9a893b671e..e678a31641 100644 --- a/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/RoomDetailsPresenterTest.kt +++ b/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/RoomDetailsPresenterTest.kt @@ -17,6 +17,7 @@ import im.vector.app.features.analytics.plan.Interaction import io.element.android.features.leaveroom.api.LeaveRoomEvent import io.element.android.features.leaveroom.api.LeaveRoomState import io.element.android.features.leaveroom.api.aLeaveRoomState +import io.element.android.features.roomdetails.impl.RoomBadge import io.element.android.features.roomdetails.impl.RoomDetailsEvent import io.element.android.features.roomdetails.impl.RoomDetailsPresenter import io.element.android.features.roomdetails.impl.RoomDetailsState @@ -134,7 +135,8 @@ class RoomDetailsPresenterTest { assertThat(initialState.isEncrypted).isEqualTo(room.isEncrypted) assertThat(initialState.canShowPinnedMessages).isTrue() assertThat(initialState.pinnedMessagesCount).isNull() - cancelAndIgnoreRemainingEvents() + assertThat(initialState.roomBadges).isEmpty() + assertThat(awaitItem().roomBadges).isEqualTo(listOf(RoomBadge.ENCRYPTED)) } } @@ -142,6 +144,7 @@ class RoomDetailsPresenterTest { fun `present - initial state is updated with roomInfo if it exists`() = runTest { val roomInfo = aRoomInfo( name = A_ROOM_NAME, + isPublic = true, topic = A_ROOM_TOPIC, avatarUrl = AN_AVATAR_URL, pinnedEventIds = listOf(AN_EVENT_ID), @@ -161,10 +164,55 @@ class RoomDetailsPresenterTest { assertThat(updatedState.roomAvatarUrl).isEqualTo(roomInfo.avatarUrl) assertThat(updatedState.roomTopic).isEqualTo(RoomTopicState.ExistingTopic(roomInfo.topic!!)) assertThat(updatedState.pinnedMessagesCount).isEqualTo(roomInfo.pinnedEventIds.size) + assertThat(updatedState.roomBadges).isEqualTo(listOf(RoomBadge.ENCRYPTED, RoomBadge.PUBLIC)) cancelAndIgnoreRemainingEvents() } } + @Test + fun `present - initial state not public not encrypted should have no badges`() = runTest { + val roomInfo = aRoomInfo( + name = A_ROOM_NAME, + isPublic = false, + ) + val room = aMatrixRoom( + isEncrypted = false, + canInviteResult = { Result.success(true) }, + canUserJoinCallResult = { Result.success(true) }, + canSendStateResult = { _, _ -> Result.success(true) }, + ).apply { + givenRoomInfo(roomInfo) + } + val presenter = createRoomDetailsPresenter(room) + presenter.test { + skipItems(1) + val updatedState = awaitItem() + assertThat(updatedState.roomBadges).isEmpty() + } + } + + @Test + fun `present - initial state public not encrypted should have not encrypted and public badges`() = runTest { + val roomInfo = aRoomInfo( + name = A_ROOM_NAME, + isPublic = true, + ) + val room = aMatrixRoom( + isEncrypted = false, + canInviteResult = { Result.success(true) }, + canUserJoinCallResult = { Result.success(true) }, + canSendStateResult = { _, _ -> Result.success(true) }, + ).apply { + givenRoomInfo(roomInfo) + } + val presenter = createRoomDetailsPresenter(room) + presenter.test { + skipItems(1) + val updatedState = awaitItem() + assertThat(updatedState.roomBadges).isEqualTo(listOf(RoomBadge.NOT_ENCRYPTED, RoomBadge.PUBLIC)) + } + } + @Test fun `present - initial state with no room name`() = runTest { val room = aMatrixRoom( From 596fe5e9e2576401c642eba6690ca56908e98803 Mon Sep 17 00:00:00 2001 From: ElementBot Date: Tue, 22 Oct 2024 08:33:00 +0000 Subject: [PATCH 07/13] Update screenshots --- ...s.userprofile.shared_UserProfileHeaderSection_Day_0_en.png | 4 ++-- ...userprofile.shared_UserProfileHeaderSection_Night_0_en.png | 4 ++-- .../features.userprofile.shared_UserProfileView_Day_0_en.png | 4 ++-- .../features.userprofile.shared_UserProfileView_Day_1_en.png | 4 ++-- .../features.userprofile.shared_UserProfileView_Day_2_en.png | 4 ++-- .../features.userprofile.shared_UserProfileView_Day_3_en.png | 4 ++-- .../features.userprofile.shared_UserProfileView_Day_4_en.png | 4 ++-- .../features.userprofile.shared_UserProfileView_Day_6_en.png | 4 ++-- .../features.userprofile.shared_UserProfileView_Day_7_en.png | 4 ++-- .../features.userprofile.shared_UserProfileView_Day_8_en.png | 3 --- ...features.userprofile.shared_UserProfileView_Night_0_en.png | 4 ++-- ...features.userprofile.shared_UserProfileView_Night_1_en.png | 4 ++-- ...features.userprofile.shared_UserProfileView_Night_2_en.png | 4 ++-- ...features.userprofile.shared_UserProfileView_Night_3_en.png | 4 ++-- ...features.userprofile.shared_UserProfileView_Night_4_en.png | 4 ++-- ...features.userprofile.shared_UserProfileView_Night_6_en.png | 4 ++-- ...features.userprofile.shared_UserProfileView_Night_7_en.png | 4 ++-- ...features.userprofile.shared_UserProfileView_Night_8_en.png | 3 --- ...nsystem.atomic.atoms_MatrixBadgeAtomNegative_Day_0_en.png} | 0 ...ystem.atomic.atoms_MatrixBadgeAtomNegative_Night_0_en.png} | 0 ...gnsystem.atomic.atoms_MatrixBadgeAtomNeutral_Day_0_en.png} | 0 ...system.atomic.atoms_MatrixBadgeAtomNeutral_Night_0_en.png} | 0 ...nsystem.atomic.atoms_MatrixBadgeAtomPositive_Day_0_en.png} | 0 ...ystem.atomic.atoms_MatrixBadgeAtomPositive_Night_0_en.png} | 0 24 files changed, 32 insertions(+), 38 deletions(-) delete mode 100644 tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_8_en.png delete mode 100644 tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_8_en.png rename tests/uitests/src/test/snapshots/images/{features.roomdetails.impl.components_RoomBadgeNegative_Day_0_en.png => libraries.designsystem.atomic.atoms_MatrixBadgeAtomNegative_Day_0_en.png} (100%) rename tests/uitests/src/test/snapshots/images/{features.roomdetails.impl.components_RoomBadgeNegative_Night_0_en.png => libraries.designsystem.atomic.atoms_MatrixBadgeAtomNegative_Night_0_en.png} (100%) rename tests/uitests/src/test/snapshots/images/{features.roomdetails.impl.components_RoomBadgeNeutral_Day_0_en.png => libraries.designsystem.atomic.atoms_MatrixBadgeAtomNeutral_Day_0_en.png} (100%) rename tests/uitests/src/test/snapshots/images/{features.roomdetails.impl.components_RoomBadgeNeutral_Night_0_en.png => libraries.designsystem.atomic.atoms_MatrixBadgeAtomNeutral_Night_0_en.png} (100%) rename tests/uitests/src/test/snapshots/images/{features.roomdetails.impl.components_RoomBadgePositive_Day_0_en.png => libraries.designsystem.atomic.atoms_MatrixBadgeAtomPositive_Day_0_en.png} (100%) rename tests/uitests/src/test/snapshots/images/{features.roomdetails.impl.components_RoomBadgePositive_Night_0_en.png => libraries.designsystem.atomic.atoms_MatrixBadgeAtomPositive_Night_0_en.png} (100%) diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileHeaderSection_Day_0_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileHeaderSection_Day_0_en.png index af2ff95e7a..9625abff26 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileHeaderSection_Day_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileHeaderSection_Day_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fd3fbba34517626f11c940e583db1b7b058575b4078e260ef5ab146076a9256e -size 12757 +oid sha256:f8f47f89b71826b87e2f6b1de8a325710f67da4c342a2fed10a253546f3b4658 +size 15303 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileHeaderSection_Night_0_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileHeaderSection_Night_0_en.png index 7d9ace4741..64841c0408 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileHeaderSection_Night_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileHeaderSection_Night_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7d6f038f3180c2f8f0a80ab608409a75fbcdb363e3e3931dda01a89cc1a7abaf -size 13078 +oid sha256:c0bed8702030f9431a281c16cbf515821be63a49a5f25d7899eee2491f1804ca +size 15405 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_0_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_0_en.png index 946bfb4494..1463fe4516 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37159c7d2974110a19aded9121c8d72d199007e97d873516bac209f5171561ba -size 21583 +oid sha256:d5641f60c900c49dfccadfff390fe2e3a72c80e7bb4bbcdecac9a8af97a01c3a +size 28709 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_1_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_1_en.png index 5984745d72..bac9b2aa0b 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_1_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_1_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5d7e07f546ef3f9147be979869d007cc35873c1856290f42472d57e3111ef0c -size 19313 +oid sha256:049980e2859db4dd266e4162f3859f129d7552ab0894ee88e3a3cf628e6fc606 +size 28993 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_2_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_2_en.png index 8e7105480d..3d1c83858c 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_2_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_2_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6cbc9ce6cfd64740584e72371325374196904ea68c79dd78c5ab525fe665d044 -size 21922 +oid sha256:6697aa15bb8f4c8381c018a167947464b3153f98e0a3a0a3763c1ef87b6444d4 +size 24247 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_3_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_3_en.png index f6ca6566c9..4f6e3ee2f7 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_3_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_3_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fec3a5602442d2fc48e0d0c603971c3d0a2d4e3e67917a00a70cec3421763946 -size 33654 +oid sha256:d2671908939f3dae083506227e389cce84f15e8a24c6fa24016e59ffc134495f +size 36247 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_4_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_4_en.png index c5e7788ac2..40eec860cc 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_4_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_4_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aef57c0efcbc88d0595ac161cdb4805459315fbcc8b27451e958806dee4712ce -size 25123 +oid sha256:313b32ffe654551c9a402d5cb4ca37bb7ec2868616e73514d3ff8fac2b476917 +size 30119 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_6_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_6_en.png index 94d1e33444..d37f5c5432 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_6_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_6_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6d32f7e0ba91562e8605e1df632c28ac38e301e2df806a46663353983bea8a94 -size 20875 +oid sha256:6fdfaa160bbee0b300422392fcd7f335db78864a03d92238eb6843fc2e50b7d1 +size 26417 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_7_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_7_en.png index 2097447376..e68b81fd36 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_7_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_7_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c75d1e76f2c4c7ec3c381fd3ecba45c4eb62ad7239a97a298ac41f686f839e99 -size 22502 +oid sha256:c33ceaeae591f4f00a1efc71b2fd469b0dabaef6449ef126acb72300b4ae8551 +size 29665 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_8_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_8_en.png deleted file mode 100644 index 946bfb4494..0000000000 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Day_8_en.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:37159c7d2974110a19aded9121c8d72d199007e97d873516bac209f5171561ba -size 21583 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_0_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_0_en.png index 249a3709db..fd6f9cd4fa 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1fb3d68142c04a84073b646d8a2daece4853b6db518033bf597d7e73cf997ca7 -size 20935 +oid sha256:6bfd432edf40bc901959d8209dd500b5102827376fd0d47fe5090882476bf5d5 +size 27771 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_1_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_1_en.png index 07423061f4..5793b79841 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_1_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_1_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bca6804dda6c169bfb90bfe562d3609ba0f844e086703150a42e0ec08a5aacf9 -size 18746 +oid sha256:08e46fd726c936a781d3ab049c4c60e080c673498ce54a3f956fce42d8ef7b90 +size 28135 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_2_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_2_en.png index bec196fd6b..ea22c51e8d 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_2_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_2_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5153d0bf8aa10335fd81fb6a6f33720edf8e0bdeb017c69d30be1ef175cb0318 -size 21263 +oid sha256:e9642867b66bdb1005802a5314e03ea33dd859aed63a882a974f71a3491fadb2 +size 23329 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_3_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_3_en.png index ef9df7777e..c9dc028683 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_3_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_3_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9926ceec284b746b2b46c15377ecdca624f1cd8303336f2d082b34602f0e6d3a -size 31172 +oid sha256:1eb2962105a905fdb832de7070d2999f32db85ff4dec0bb66ec707b224fb446d +size 33428 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_4_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_4_en.png index b89a168a68..8cfba389bb 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_4_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_4_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3bc079ddb639f05d60cf702fd0a8c1ae01520f19204df271fdc5a203c1442eee -size 22979 +oid sha256:bff4a01c20d94363238b106d42c596810f0cf8ea5f14e3207bee984966b92f3a +size 27542 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_6_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_6_en.png index e81c2ab75e..00a087a240 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_6_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_6_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58a2a378b174cf93de0925872ea6e980c724967751b0feabba51eeb6261f4318 -size 19065 +oid sha256:fca592210633e752cccfbcac3373acdd0ca55277fce9473b0e1b7db32ea19a04 +size 24208 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_7_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_7_en.png index 24cae66ca2..0cd496c1f1 100644 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_7_en.png +++ b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_7_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0d7d7bf305375a306d1d1f002527f7ac81daf4f3387041035df4f9ef0f80c82e -size 21809 +oid sha256:6058bb4b845ba2a174c1d35baa0e44604ec14e1d618b9a66f6825a58da81e61a +size 28649 diff --git a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_8_en.png b/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_8_en.png deleted file mode 100644 index 249a3709db..0000000000 --- a/tests/uitests/src/test/snapshots/images/features.userprofile.shared_UserProfileView_Night_8_en.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1fb3d68142c04a84073b646d8a2daece4853b6db518033bf597d7e73cf997ca7 -size 20935 diff --git a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgeNegative_Day_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomNegative_Day_0_en.png similarity index 100% rename from tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgeNegative_Day_0_en.png rename to tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomNegative_Day_0_en.png diff --git a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgeNegative_Night_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomNegative_Night_0_en.png similarity index 100% rename from tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgeNegative_Night_0_en.png rename to tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomNegative_Night_0_en.png diff --git a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgeNeutral_Day_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomNeutral_Day_0_en.png similarity index 100% rename from tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgeNeutral_Day_0_en.png rename to tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomNeutral_Day_0_en.png diff --git a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgeNeutral_Night_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomNeutral_Night_0_en.png similarity index 100% rename from tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgeNeutral_Night_0_en.png rename to tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomNeutral_Night_0_en.png diff --git a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgePositive_Day_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomPositive_Day_0_en.png similarity index 100% rename from tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgePositive_Day_0_en.png rename to tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomPositive_Day_0_en.png diff --git a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgePositive_Night_0_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomPositive_Night_0_en.png similarity index 100% rename from tests/uitests/src/test/snapshots/images/features.roomdetails.impl.components_RoomBadgePositive_Night_0_en.png rename to tests/uitests/src/test/snapshots/images/libraries.designsystem.atomic.atoms_MatrixBadgeAtomPositive_Night_0_en.png From 3c23555eb70d53287361c68a5e1bb212ae5ca1e2 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 22 Oct 2024 14:19:07 +0200 Subject: [PATCH 08/13] Code quality --- .../android/features/roomdetails/impl/RoomDetailsState.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt index 3116f70015..21fa239c82 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt @@ -62,5 +62,5 @@ sealed interface RoomTopicState { enum class RoomBadge { ENCRYPTED, NOT_ENCRYPTED, - PUBLIC; + PUBLIC, } From 35867f9837e993fab4e0da4c29abeea5747729b2 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 23 Oct 2024 12:59:56 +0200 Subject: [PATCH 09/13] Let roomBadges be a computed val of RoomDetailsState --- .../roomdetails/impl/RoomDetailsPresenter.kt | 17 ------ .../roomdetails/impl/RoomDetailsState.kt | 17 +++++- .../impl/RoomDetailsStateProvider.kt | 13 ----- .../{ => impl}/RoomDetailsPresenterTest.kt | 57 +------------------ .../roomdetails/impl/RoomDetailsStateTest.kt | 56 ++++++++++++++++++ 5 files changed, 74 insertions(+), 86 deletions(-) rename features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/{ => impl}/RoomDetailsPresenterTest.kt (92%) create mode 100644 features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateTest.kt diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt index 2594fd5509..eccc8dd9d2 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt @@ -43,7 +43,6 @@ import io.element.android.libraries.matrix.ui.room.getDirectRoomMember import io.element.android.libraries.matrix.ui.room.isOwnUserAdmin import io.element.android.services.analytics.api.AnalyticsService import io.element.android.services.analyticsproviders.api.trackers.captureInteraction -import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.launchIn @@ -113,21 +112,6 @@ class RoomDetailsPresenter @Inject constructor( val roomNotificationSettingsState by room.roomNotificationSettingsStateFlow.collectAsState() - val roomBadges by produceState(persistentListOf(), isPublic) { - value = buildList { - if (room.isEncrypted || isPublic) { - if (room.isEncrypted) { - add(RoomBadge.ENCRYPTED) - } else { - add(RoomBadge.NOT_ENCRYPTED) - } - } - if (isPublic) { - add(RoomBadge.PUBLIC) - } - }.toPersistentList() - } - fun handleEvents(event: RoomDetailsEvent) { when (event) { RoomDetailsEvent.LeaveRoom -> @@ -167,7 +151,6 @@ class RoomDetailsPresenter @Inject constructor( isFavorite = isFavorite, displayRolesAndPermissionsSettings = !room.isDm && isUserAdmin, isPublic = isPublic, - roomBadges = roomBadges, heroes = roomInfo?.heroes.orEmpty().toPersistentList(), canShowPinnedMessages = canShowPinnedMessages, pinnedMessagesCount = pinnedMessagesCount, diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt index 21fa239c82..2208748563 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt @@ -16,6 +16,7 @@ import io.element.android.libraries.matrix.api.room.RoomMember import io.element.android.libraries.matrix.api.room.RoomNotificationSettings import io.element.android.libraries.matrix.api.user.MatrixUser import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.toPersistentList data class RoomDetailsState( val roomId: RoomId, @@ -36,12 +37,24 @@ data class RoomDetailsState( val isFavorite: Boolean, val displayRolesAndPermissionsSettings: Boolean, val isPublic: Boolean, - val roomBadges: ImmutableList, val heroes: ImmutableList, val canShowPinnedMessages: Boolean, val pinnedMessagesCount: Int?, val eventSink: (RoomDetailsEvent) -> Unit -) +) { + val roomBadges = buildList { + if (isEncrypted || isPublic) { + if (isEncrypted) { + add(RoomBadge.ENCRYPTED) + } else { + add(RoomBadge.NOT_ENCRYPTED) + } + } + if (isPublic) { + add(RoomBadge.PUBLIC) + } + }.toPersistentList() +} @Immutable sealed interface RoomDetailsType { diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt index 5462bc65a7..d9b0c22c65 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt @@ -96,18 +96,6 @@ fun aRoomDetailsState( isFavorite: Boolean = false, displayAdminSettings: Boolean = false, isPublic: Boolean = true, - roomBadges: List = buildList { - if (isEncrypted || isPublic) { - if (isEncrypted) { - add(RoomBadge.ENCRYPTED) - } else { - add(RoomBadge.NOT_ENCRYPTED) - } - } - if (isPublic) { - add(RoomBadge.PUBLIC) - } - }, heroes: List = emptyList(), canShowPinnedMessages: Boolean = true, pinnedMessagesCount: Int? = null, @@ -131,7 +119,6 @@ fun aRoomDetailsState( isFavorite = isFavorite, displayRolesAndPermissionsSettings = displayAdminSettings, isPublic = isPublic, - roomBadges = roomBadges.toPersistentList(), heroes = heroes.toPersistentList(), canShowPinnedMessages = canShowPinnedMessages, pinnedMessagesCount = pinnedMessagesCount, diff --git a/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/RoomDetailsPresenterTest.kt b/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenterTest.kt similarity index 92% rename from features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/RoomDetailsPresenterTest.kt rename to features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenterTest.kt index e678a31641..ea83f89181 100644 --- a/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/RoomDetailsPresenterTest.kt +++ b/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenterTest.kt @@ -5,7 +5,7 @@ * Please see LICENSE in the repository root for full details. */ -package io.element.android.features.roomdetails +package io.element.android.features.roomdetails.impl import androidx.lifecycle.Lifecycle import app.cash.molecule.RecompositionMode @@ -17,12 +17,7 @@ import im.vector.app.features.analytics.plan.Interaction import io.element.android.features.leaveroom.api.LeaveRoomEvent import io.element.android.features.leaveroom.api.LeaveRoomState import io.element.android.features.leaveroom.api.aLeaveRoomState -import io.element.android.features.roomdetails.impl.RoomBadge -import io.element.android.features.roomdetails.impl.RoomDetailsEvent -import io.element.android.features.roomdetails.impl.RoomDetailsPresenter -import io.element.android.features.roomdetails.impl.RoomDetailsState -import io.element.android.features.roomdetails.impl.RoomDetailsType -import io.element.android.features.roomdetails.impl.RoomTopicState +import io.element.android.features.roomdetails.aMatrixRoom import io.element.android.features.roomdetails.impl.members.aRoomMember import io.element.android.features.roomdetails.impl.members.details.RoomMemberDetailsPresenter import io.element.android.features.userprofile.shared.aUserProfileState @@ -126,6 +121,7 @@ class RoomDetailsPresenterTest { ) val presenter = createRoomDetailsPresenter(room) presenter.test { + skipItems(1) val initialState = awaitItem() assertThat(initialState.roomId).isEqualTo(room.roomId) assertThat(initialState.roomName).isEqualTo(room.displayName) @@ -135,8 +131,6 @@ class RoomDetailsPresenterTest { assertThat(initialState.isEncrypted).isEqualTo(room.isEncrypted) assertThat(initialState.canShowPinnedMessages).isTrue() assertThat(initialState.pinnedMessagesCount).isNull() - assertThat(initialState.roomBadges).isEmpty() - assertThat(awaitItem().roomBadges).isEqualTo(listOf(RoomBadge.ENCRYPTED)) } } @@ -164,55 +158,10 @@ class RoomDetailsPresenterTest { assertThat(updatedState.roomAvatarUrl).isEqualTo(roomInfo.avatarUrl) assertThat(updatedState.roomTopic).isEqualTo(RoomTopicState.ExistingTopic(roomInfo.topic!!)) assertThat(updatedState.pinnedMessagesCount).isEqualTo(roomInfo.pinnedEventIds.size) - assertThat(updatedState.roomBadges).isEqualTo(listOf(RoomBadge.ENCRYPTED, RoomBadge.PUBLIC)) cancelAndIgnoreRemainingEvents() } } - @Test - fun `present - initial state not public not encrypted should have no badges`() = runTest { - val roomInfo = aRoomInfo( - name = A_ROOM_NAME, - isPublic = false, - ) - val room = aMatrixRoom( - isEncrypted = false, - canInviteResult = { Result.success(true) }, - canUserJoinCallResult = { Result.success(true) }, - canSendStateResult = { _, _ -> Result.success(true) }, - ).apply { - givenRoomInfo(roomInfo) - } - val presenter = createRoomDetailsPresenter(room) - presenter.test { - skipItems(1) - val updatedState = awaitItem() - assertThat(updatedState.roomBadges).isEmpty() - } - } - - @Test - fun `present - initial state public not encrypted should have not encrypted and public badges`() = runTest { - val roomInfo = aRoomInfo( - name = A_ROOM_NAME, - isPublic = true, - ) - val room = aMatrixRoom( - isEncrypted = false, - canInviteResult = { Result.success(true) }, - canUserJoinCallResult = { Result.success(true) }, - canSendStateResult = { _, _ -> Result.success(true) }, - ).apply { - givenRoomInfo(roomInfo) - } - val presenter = createRoomDetailsPresenter(room) - presenter.test { - skipItems(1) - val updatedState = awaitItem() - assertThat(updatedState.roomBadges).isEqualTo(listOf(RoomBadge.NOT_ENCRYPTED, RoomBadge.PUBLIC)) - } - } - @Test fun `present - initial state with no room name`() = runTest { val room = aMatrixRoom( diff --git a/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateTest.kt b/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateTest.kt new file mode 100644 index 0000000000..65e291a9a1 --- /dev/null +++ b/features/roomdetails/impl/src/test/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateTest.kt @@ -0,0 +1,56 @@ +/* + * Copyright 2024 New Vector Ltd. + * + * SPDX-License-Identifier: AGPL-3.0-only + * Please see LICENSE in the repository root for full details. + */ + +package io.element.android.features.roomdetails.impl + +import com.google.common.truth.Truth.assertThat +import kotlinx.collections.immutable.persistentListOf +import org.junit.Test + +class RoomDetailsStateTest { + @Test + fun `room not public not encrypted should have no badges`() { + val sut = aRoomDetailsState( + isPublic = false, + isEncrypted = false, + ) + assertThat(sut.roomBadges).isEmpty() + } + + @Test + fun `room public not encrypted should have not encrypted and public badges`() { + val sut = aRoomDetailsState( + isPublic = true, + isEncrypted = false, + ) + assertThat(sut.roomBadges).isEqualTo( + persistentListOf(RoomBadge.NOT_ENCRYPTED, RoomBadge.PUBLIC) + ) + } + + @Test + fun `room public encrypted should have encrypted and public badges`() { + val sut = aRoomDetailsState( + isPublic = true, + isEncrypted = true, + ) + assertThat(sut.roomBadges).isEqualTo( + persistentListOf(RoomBadge.ENCRYPTED, RoomBadge.PUBLIC) + ) + } + + @Test + fun `room not public encrypted should have encrypted badges`() { + val sut = aRoomDetailsState( + isPublic = false, + isEncrypted = true, + ) + assertThat(sut.roomBadges).isEqualTo( + persistentListOf(RoomBadge.ENCRYPTED) + ) + } +} From 2eec17fec7e630239abddadcdeec6fde22c47127 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 23 Oct 2024 13:06:55 +0200 Subject: [PATCH 10/13] Ensure modifier of `BadgeList` is used. --- .../roomdetails/impl/RoomDetailsView.kt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index b37b23a898..163a2c5fd5 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -10,6 +10,7 @@ package io.element.android.features.roomdetails.impl import androidx.compose.foundation.clickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ColumnScope import androidx.compose.foundation.layout.Row @@ -405,13 +406,15 @@ private fun BadgeList( roomBadge: ImmutableList, modifier: Modifier = Modifier, ) { - if (roomBadge.isEmpty()) return - MatrixBadgeRowMolecule( - modifier = modifier, - data = roomBadge.map { - it.toMatrixBadgeData() - }.toImmutableList(), - ) + Box(modifier = modifier) { + if (roomBadge.isNotEmpty()) { + MatrixBadgeRowMolecule( + data = roomBadge.map { + it.toMatrixBadgeData() + }.toImmutableList(), + ) + } + } } @Composable From f516c09d3b5893211d5aeeacf43020e94ac46657 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 23 Oct 2024 13:07:30 +0200 Subject: [PATCH 11/13] Change a preview to have a room detail state without any badge. --- .../features/roomdetails/impl/RoomDetailsStateProvider.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt index d9b0c22c65..4f95c0d723 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt @@ -33,7 +33,7 @@ open class RoomDetailsStateProvider : PreviewParameterProvider aRoomDetailsState(isEncrypted = false), aRoomDetailsState(roomAlias = null), aDmRoomDetailsState(), - aDmRoomDetailsState(isDmMemberIgnored = true), + aDmRoomDetailsState(isDmMemberIgnored = true, roomName = "Daniel (ignored and clear)", isEncrypted = false), aRoomDetailsState(canInvite = true), aRoomDetailsState(isFavorite = true), aRoomDetailsState( @@ -136,12 +136,14 @@ fun aRoomNotificationSettings( fun aDmRoomDetailsState( isDmMemberIgnored: Boolean = false, roomName: String = "Daniel", + isEncrypted: Boolean = true, ) = aRoomDetailsState( roomName = roomName, isPublic = false, + isEncrypted = isEncrypted, roomType = RoomDetailsType.Dm( - aRoomMember(), - aDmRoomMember(isIgnored = isDmMemberIgnored), + me = aRoomMember(), + otherMember = aDmRoomMember(isIgnored = isDmMemberIgnored), ), roomMemberDetailsState = aUserProfileState() ) From 67efecdec63b79a5558d7b16fffcb686eb50cbf7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 23 Oct 2024 13:13:40 +0200 Subject: [PATCH 12/13] Fix preview for ignore user in a DM case. --- .../features/roomdetails/impl/RoomDetailsStateProvider.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt index 4f95c0d723..7e71d2b39f 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt @@ -13,6 +13,7 @@ import io.element.android.features.leaveroom.api.aLeaveRoomState import io.element.android.features.roomdetails.impl.members.aRoomMember import io.element.android.features.userprofile.api.UserProfileState import io.element.android.features.userprofile.shared.aUserProfileState +import io.element.android.libraries.architecture.AsyncData import io.element.android.libraries.matrix.api.core.RoomAlias import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.matrix.api.core.UserId @@ -145,5 +146,7 @@ fun aDmRoomDetailsState( me = aRoomMember(), otherMember = aDmRoomMember(isIgnored = isDmMemberIgnored), ), - roomMemberDetailsState = aUserProfileState() + roomMemberDetailsState = aUserProfileState( + isBlocked = AsyncData.Success(isDmMemberIgnored), + ) ) From 4820cd0ed106c49039c25153edd43c0725c20fa8 Mon Sep 17 00:00:00 2001 From: ElementBot Date: Wed, 23 Oct 2024 11:23:26 +0000 Subject: [PATCH 13/13] Update screenshots --- .../images/features.roomdetails.impl_RoomDetailsDark_6_en.png | 4 ++-- .../images/features.roomdetails.impl_RoomDetails_6_en.png | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl_RoomDetailsDark_6_en.png b/tests/uitests/src/test/snapshots/images/features.roomdetails.impl_RoomDetailsDark_6_en.png index e55839bd1d..b2b388bb2d 100644 --- a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl_RoomDetailsDark_6_en.png +++ b/tests/uitests/src/test/snapshots/images/features.roomdetails.impl_RoomDetailsDark_6_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f9d3d78555516e89ebabbf4a42999c3a5eaa592a61f21cedd8860acd7a77210c -size 42214 +oid sha256:53f64097a1b58c155764740d08587ef3c1ffd75d0e5592906f35a208ad1d22ba +size 38455 diff --git a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl_RoomDetails_6_en.png b/tests/uitests/src/test/snapshots/images/features.roomdetails.impl_RoomDetails_6_en.png index 43385fb15e..394fd70ff3 100644 --- a/tests/uitests/src/test/snapshots/images/features.roomdetails.impl_RoomDetails_6_en.png +++ b/tests/uitests/src/test/snapshots/images/features.roomdetails.impl_RoomDetails_6_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b785267e5fbda41dc3b7ee054459cbcd19a7e7c6b750ce747034a11ff1236531 -size 43065 +oid sha256:010ebb10eb97f9eef21bf6ed2d2471a4e883a0886195dc43d117e4c8a0c61352 +size 39619