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 259c5c08578..5e31466baec 100644 --- a/stream-chat-android-compose/api/stream-chat-android-compose.api +++ b/stream-chat-android-compose/api/stream-chat-android-compose.api @@ -1640,6 +1640,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..5d76d1854b8 --- /dev/null +++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/SwipeToReplyIcon.kt @@ -0,0 +1,63 @@ +/* + * 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() + .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 f2f94a95244..c9705e2cb32 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 @@ -2706,13 +2707,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 00000000000..d89b255f65f Binary files /dev/null and b/stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_SwipeToReplyIconTest_swipe_to_reply_icon.png differ