From fc200e9a8174b9d99dc8ecd96e92f523d38ab436 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 21 Oct 2024 15:26:18 +0200 Subject: [PATCH 1/4] Use ic_compound_unpin --- .../messages/impl/actionlist/model/TimelineItemAction.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/model/TimelineItemAction.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/model/TimelineItemAction.kt index 41e7bc724b0..cddf3ff8e42 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/model/TimelineItemAction.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/model/TimelineItemAction.kt @@ -32,7 +32,5 @@ sealed class TimelineItemAction( data object ReportContent : TimelineItemAction(CommonStrings.action_report_content, CompoundDrawables.ic_compound_chat_problem, destructive = true) data object EndPoll : TimelineItemAction(CommonStrings.action_end_poll, CompoundDrawables.ic_compound_polls_end) data object Pin : TimelineItemAction(CommonStrings.action_pin, CompoundDrawables.ic_compound_pin) - - // TODO use the Unpin compound icon when available. - data object Unpin : TimelineItemAction(CommonStrings.action_unpin, CompoundDrawables.ic_compound_pin) + data object Unpin : TimelineItemAction(CommonStrings.action_unpin, CompoundDrawables.ic_compound_unpin) } From aaf14b6604732b3cd3a1b4f1ac363c1ff9ea9efd Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 19 Aug 2024 14:16:45 +0200 Subject: [PATCH 2/4] Change preview to test wrapping of long pinned message. --- .../pinned/banner/PinnedMessagesBannerStateProvider.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerStateProvider.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerStateProvider.kt index 6ea79ef4151..d9dabb57a76 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerStateProvider.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerStateProvider.kt @@ -19,7 +19,11 @@ internal class PinnedMessagesBannerStateProvider : PreviewParameterProvider Unit = {} ) = PinnedMessagesBannerState.Loaded( From 96232d5cdf46814f4626f2e5fb8bfc7e847aea1a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 19 Aug 2024 14:22:22 +0200 Subject: [PATCH 3/4] Reduce space between message and "View All" button --- .../impl/pinned/banner/PinnedMessagesBannerView.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerView.kt index ed7e8be652b..3c8e4bc6db0 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerView.kt @@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable @@ -98,9 +99,8 @@ private fun PinnedMessagesBannerRow( } }, verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = spacedBy(10.dp) ) { - Spacer(modifier = Modifier.width(16.dp)) + Spacer(modifier = Modifier.width(26.dp)) PinIndicators( pinIndex = state.currentPinnedMessageIndex(), pinsCount = state.pinnedMessagesCount(), @@ -109,7 +109,9 @@ private fun PinnedMessagesBannerRow( imageVector = CompoundIcons.PinSolid(), contentDescription = null, tint = ElementTheme.materialColors.secondary, - modifier = Modifier.size(20.dp) + modifier = Modifier + .padding(horizontal = 10.dp) + .size(20.dp) ) PinnedMessageItem( index = state.currentPinnedMessageIndex(), From 385a4c90f5337c3406b9f3821848edfc003a51b0 Mon Sep 17 00:00:00 2001 From: ElementBot Date: Mon, 21 Oct 2024 13:44:50 +0000 Subject: [PATCH 4/4] Update screenshots --- ...s.impl.pinned.banner_PinnedMessagesBannerView_Day_4_en.png | 4 ++-- ...impl.pinned.banner_PinnedMessagesBannerView_Night_4_en.png | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/uitests/src/test/snapshots/images/features.messages.impl.pinned.banner_PinnedMessagesBannerView_Day_4_en.png b/tests/uitests/src/test/snapshots/images/features.messages.impl.pinned.banner_PinnedMessagesBannerView_Day_4_en.png index 71627c10410..e7038a64e4a 100644 --- a/tests/uitests/src/test/snapshots/images/features.messages.impl.pinned.banner_PinnedMessagesBannerView_Day_4_en.png +++ b/tests/uitests/src/test/snapshots/images/features.messages.impl.pinned.banner_PinnedMessagesBannerView_Day_4_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:35f12c5ebb668fd4fa340d6657cc7c758eaac73c7ba758acb5d066009edea422 -size 12943 +oid sha256:168b7b210c781588a53bfacdbeb64f694d227de488578a4a3c3545d111725acc +size 13515 diff --git a/tests/uitests/src/test/snapshots/images/features.messages.impl.pinned.banner_PinnedMessagesBannerView_Night_4_en.png b/tests/uitests/src/test/snapshots/images/features.messages.impl.pinned.banner_PinnedMessagesBannerView_Night_4_en.png index 175cd36d4f1..c82a97b618f 100644 --- a/tests/uitests/src/test/snapshots/images/features.messages.impl.pinned.banner_PinnedMessagesBannerView_Night_4_en.png +++ b/tests/uitests/src/test/snapshots/images/features.messages.impl.pinned.banner_PinnedMessagesBannerView_Night_4_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea13db4a7e464584ff8e7581b794f3bd5dbbc6fb30341fc65d1cdfbf90aab813 -size 12353 +oid sha256:5aa6e199123276936b44e009f05696d00d4b3000b82e67c6280b5f15a92d2a8a +size 12891