From 646c26dee8d984ef17ef4490b08c89d02e956d3f Mon Sep 17 00:00:00 2001 From: VelikovPetar Date: Thu, 12 Mar 2026 14:47:19 +0100 Subject: [PATCH 1/2] Update SwipeToReplyIcon. --- .../api/stream-chat-android-compose.api | 7 ++ .../components/messages/SwipeToReplyIcon.kt | 67 ++++++++++++++++++ .../compose/ui/theme/ChatComponentFactory.kt | 9 +-- .../messages/SwipeToReplyIconTest.kt | 36 ++++++++++ ...ipeToReplyIconTest_swipe_to_reply_icon.png | Bin 0 -> 6586 bytes 5 files changed, 112 insertions(+), 7 deletions(-) create mode 100644 stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt create mode 100644 stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIconTest.kt create mode 100644 stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_SwipeToReplyIconTest_swipe_to_reply_icon.png diff --git a/stream-chat-android-compose/api/stream-chat-android-compose.api b/stream-chat-android-compose/api/stream-chat-android-compose.api index 4558c82793f..ce2a4c3b25b 100644 --- a/stream-chat-android-compose/api/stream-chat-android-compose.api +++ b/stream-chat-android-compose/api/stream-chat-android-compose.api @@ -1774,6 +1774,13 @@ public final class io/getstream/chat/android/compose/ui/components/messages/Comp public final fun getLambda-2$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2; } +public final class io/getstream/chat/android/compose/ui/components/messages/ComposableSingletons$SwipeToReplyIconKt { + public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/messages/ComposableSingletons$SwipeToReplyIconKt; + public static field lambda-1 Lkotlin/jvm/functions/Function2; + public fun ()V + public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2; +} + public final class io/getstream/chat/android/compose/ui/components/messages/GiphyMessageContentKt { public static final fun GiphyMessageContent (Lio/getstream/chat/android/models/Message;Lio/getstream/chat/android/models/User;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V } diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt new file mode 100644 index 00000000000..904a99c8b84 --- /dev/null +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014-2026 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.compose.ui.components.messages + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material3.Icon +import androidx.compose.material3.minimumInteractiveComponentSize +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import io.getstream.chat.android.compose.R +import io.getstream.chat.android.compose.ui.theme.ChatPreviewTheme +import io.getstream.chat.android.compose.ui.theme.ChatTheme + +/** + * Represents the default Swipe-to-reply icon. + */ +@Composable +internal fun SwipeToReplyIcon() { + Box( + modifier = Modifier.minimumInteractiveComponentSize(), + contentAlignment = Alignment.Center, + ) { + Box( + modifier = Modifier + .size(32.dp) + .clip(CircleShape) + .background(ChatTheme.colors.buttonSecondaryBg, CircleShape), + contentAlignment = Alignment.Center, + ) { + Icon( + painter = painterResource(R.drawable.stream_compose_ic_reply), + contentDescription = "", + tint = ChatTheme.colors.buttonSecondaryTextOnAccent, + ) + } + } +} + +@Preview +@Composable +private fun SwipeToReplyIconPreview() { + ChatPreviewTheme { + SwipeToReplyIcon() + } +} diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt index e1a2e97cc4f..9ece77f223f 100644 --- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt @@ -134,6 +134,7 @@ import io.getstream.chat.android.compose.ui.components.messages.OwnedMessageVisi import io.getstream.chat.android.compose.ui.components.messages.QuotedMessage import io.getstream.chat.android.compose.ui.components.messages.ScrollToBottomButton import io.getstream.chat.android.compose.ui.components.messages.SegmentedMessageReactions +import io.getstream.chat.android.compose.ui.components.messages.SwipeToReplyIcon import io.getstream.chat.android.compose.ui.components.reactionpicker.ReactionsPicker import io.getstream.chat.android.compose.ui.components.reactions.ReactionIconSize import io.getstream.chat.android.compose.ui.components.reactions.ReactionToggleSize @@ -2702,13 +2703,7 @@ public interface ChatComponentFactory { */ @Composable public fun RowScope.SwipeToReplyContent() { - Box { - Icon( - painter = painterResource(id = R.drawable.stream_compose_ic_reply), - contentDescription = "", - tint = ChatTheme.colors.textSecondary, - ) - } + SwipeToReplyIcon() } /** diff --git a/stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIconTest.kt b/stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIconTest.kt new file mode 100644 index 00000000000..2d69574c05e --- /dev/null +++ b/stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIconTest.kt @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2014-2026 Stream.io Inc. All rights reserved. + * + * Licensed under the Stream License; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://github.com/GetStream/stream-chat-android/blob/main/LICENSE + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.getstream.chat.android.compose.ui.components.messages + +import app.cash.paparazzi.DeviceConfig +import app.cash.paparazzi.Paparazzi +import io.getstream.chat.android.compose.ui.PaparazziComposeTest +import org.junit.Rule +import org.junit.Test + +internal class SwipeToReplyIconTest : PaparazziComposeTest { + + @get:Rule + override val paparazzi = Paparazzi(deviceConfig = DeviceConfig.PIXEL_2) + + @Test + fun `swipe to reply icon`() { + snapshotWithDarkModeRow { + SwipeToReplyIcon() + } + } +} diff --git a/stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_SwipeToReplyIconTest_swipe_to_reply_icon.png b/stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_SwipeToReplyIconTest_swipe_to_reply_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d89b255f65fda84ee4daa4530df88448587d5aed GIT binary patch literal 6586 zcmeHMXHZjV+YXBeB7%q_9U>AysiDMxbQO^ZND&dFNC?tIK&2OzPJpa{p`)@ir59-- zpkN4suoPjbp?8QxAS9H$aaTvb_uZZOW_G@JzMb*ceV%ik>pAy4&wX9@b>>7F8R#Bj z33R$j{X7w@IKHxr)BChv@+_CN}365@;H3#ypgG< zlwGZq_qE?<;yBA5+9qAsHO9cWWEGM`B(I0>HN#Vl7h1}qG8X%8^?ATldw~fLlMCNwpkkWFWSfc&eXY;twcqQ?R6CenkwxfmOmBkvCx2?i5-`MVjA5QZ zh6+>2=1rvh3N&NqIa4T7{sJDr!fTI2G0?AZEWDa{9{W(X5Y*S}zkJZ~mJd8y@6B=k z{CT@ypK96RQ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#U8Qx_6Tk56^xV*;{$teWS5th7v2QPyfs(}9o;#ur4Qs% zqt0h93^Z;Ixi|*iu(FsLXQ1$Z_5v0qXQTDYf@!PUJ>)t#AGq6ci6**Bb*E9HD>PWT z9K`HNs_-Gtt00G!p{j*o%@MisoHTEfF@Iviv|0&<6#f3hGfkb@7K;?BvUJYg6jMy^ z6=Ox)b1@KN?#P-y8APOXlJeZRo#>o}Sq+W!&%J439(EhUKw&9hu_NWMmY_oROyR`P`I9Mvooa_!A$Ai#GUZ2j41L@i@xbvN8BNiSWd8o zo5!6GX69k)fz*@jdCY7)hl?9Fho%c-a{5HzLn`tHaY8Pz)q7FxdG^ySNrs(u^fv)y zsJ}aJ0MH)E3I6QDd4PFMa* zQ_|9h007EGJOH4*AD~GO^cB7Y0FV(N0tb8zp=`g8=ph8f05}Z(8a@N*qd&*fSNn7P zw`Kkf|1FKr!0+(DsTcs@8|+IGUtjwT_Ww0|{U6zXEt&7m?!Qwx|Kz>@pS=4#^_-PwK7|NrC4`3LX)-{;L=@b0@q z_}c{f(Ki27^L{j*FN*(7`2WLj{b-wC4d87stO>-haii{8i(L+tx6s X=2jY-oFdTw$pG}u8=NcFwte_7mIX=? literal 0 HcmV?d00001 From d4cc622e62b8f1864f8b85670cc1f2366a785b7a Mon Sep 17 00:00:00 2001 From: VelikovPetar Date: Thu, 12 Mar 2026 15:20:56 +0100 Subject: [PATCH 2/2] Fix remark. --- .../components/messages/SwipeToReplyIcon.kt | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt index 904a99c8b84..5d76d1854b8 100644 --- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt @@ -39,22 +39,18 @@ import io.getstream.chat.android.compose.ui.theme.ChatTheme @Composable internal fun SwipeToReplyIcon() { Box( - modifier = Modifier.minimumInteractiveComponentSize(), + modifier = Modifier + .minimumInteractiveComponentSize() + .size(32.dp) + .clip(CircleShape) + .background(ChatTheme.colors.buttonSecondaryBg, CircleShape), contentAlignment = Alignment.Center, ) { - Box( - modifier = Modifier - .size(32.dp) - .clip(CircleShape) - .background(ChatTheme.colors.buttonSecondaryBg, CircleShape), - contentAlignment = Alignment.Center, - ) { - Icon( - painter = painterResource(R.drawable.stream_compose_ic_reply), - contentDescription = "", - tint = ChatTheme.colors.buttonSecondaryTextOnAccent, - ) - } + Icon( + painter = painterResource(R.drawable.stream_compose_ic_reply), + contentDescription = "", + tint = ChatTheme.colors.buttonSecondaryTextOnAccent, + ) } }