Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ private class DefaultMessagePreviewFormatter(
}
val videos = attachments.filter { it.type == AttachmentType.VIDEO }
val files = attachments.filter { it.type == AttachmentType.FILE }
val giphy = attachments.filter { it.type == AttachmentType.GIPHY }

when {
images.isNotEmpty() -> {
Expand Down Expand Up @@ -290,6 +291,12 @@ private class DefaultMessagePreviewFormatter(
)
}

giphy.isNotEmpty() -> {
appendInlineContent(DefaultMessagePreviewIconFactory.GIPHY)
append(SPACE)
append(context.getString(R.string.stream_compose_giphy_preview))
}

links.isNotEmpty() -> {
appendInlineContent(DefaultMessagePreviewIconFactory.LINK)
append(SPACE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ internal class DefaultMessagePreviewIconFactory : MessagePreviewIconFactory {
internal const val LOCATION = "location"
internal const val POLL = "poll"
internal const val DELETED = "deleted"
internal const val GIPHY = "giphy"
}

@Suppress("LongMethod")
Expand Down Expand Up @@ -106,6 +107,14 @@ internal class DefaultMessagePreviewIconFactory : MessagePreviewIconFactory {
tint = ChatTheme.colors.textSecondary,
)
},
GIPHY to InlineTextContent(placeholder) {
Icon(
modifier = iconModifier,
painter = painterResource(id = R.drawable.stream_compose_ic_giphy),
contentDescription = null,
tint = ChatTheme.colors.textSecondary,
)
},
LINK to InlineTextContent(placeholder) {
Icon(
modifier = iconModifier,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:pathData="M6.375,1.625V3.625C6.375,4.177 6.823,4.625 7.375,4.625H9.375M5.961,1.375H3.375C2.823,1.375 2.375,1.823 2.375,2.375V9.625C2.375,10.177 2.823,10.625 3.375,10.625H8.625C9.177,10.625 9.625,10.177 9.625,9.625V5.039C9.625,4.774 9.52,4.52 9.332,4.332L6.668,1.668C6.48,1.48 6.226,1.375 5.961,1.375Z"
android:strokeLineJoin="round"
android:strokeWidth="1.2"
android:fillColor="#00000000"
android:strokeColor="#384047"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
<string name="stream_compose_photo_preview">Photo</string>
<string name="stream_compose_video_preview">Video</string>
<string name="stream_compose_file_preview">File</string>
<string name="stream_compose_giphy_preview">Giphy</string>
<string name="stream_compose_link_preview">Link</string>
<string name="stream_compose_message_deleted_preview">Message deleted</string>
<string name="stream_compose_no_messages_yet">No messages yet</string>
Expand Down
Loading