diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt index c77a755f5e..a871e73690 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt @@ -31,6 +31,7 @@ import im.vector.app.core.files.LocalFilesHelper import im.vector.app.core.glide.GlideApp import im.vector.app.features.home.room.detail.timeline.helper.ContentUploadStateTrackerBinder import im.vector.app.features.media.ImageContentRenderer +import im.vector.app.features.themes.BubbleThemeUtils @EpoxyModelClass(layout = R.layout.item_timeline_event_base) abstract class MessageImageVideoItem : AbsMessageItem() { @@ -105,6 +106,20 @@ abstract class MessageImageVideoItem : AbsMessageItem Align ImageView within its parent to the same side as message bubbles (holder.imageView.layoutParams as ConstraintLayout.LayoutParams).horizontalBias = if (reverseBubble) 1f else 0f + + // Image outline + when { + bubbleStyle == BubbleThemeUtils.BUBBLE_STYLE_NONE || mode != ImageContentRenderer.Mode.THUMBNAIL -> { + // Don't show it for non-bubble layouts, don't show for Stickers, ... + holder.mediaContentView.background = null + } + attributes.informationData.sentByMe -> { + holder.mediaContentView.setBackgroundResource(R.drawable.background_image_border_outgoing) + } + else -> { + holder.mediaContentView.setBackgroundResource(R.drawable.background_image_border_incoming) + } + } } override fun allowFooterOverlay(holder: Holder): Boolean { diff --git a/vector/src/main/res/drawable/background_image_border_incoming.xml b/vector/src/main/res/drawable/background_image_border_incoming.xml new file mode 100644 index 0000000000..b2ac60603c --- /dev/null +++ b/vector/src/main/res/drawable/background_image_border_incoming.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/vector/src/main/res/drawable/background_image_border_outgoing.xml b/vector/src/main/res/drawable/background_image_border_outgoing.xml new file mode 100644 index 0000000000..066c8f4c6c --- /dev/null +++ b/vector/src/main/res/drawable/background_image_border_outgoing.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file