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 2c52c04154..9d7caa828c 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 @@ -32,6 +32,7 @@ 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 +import org.matrix.android.sdk.api.util.MimeTypes @EpoxyModelClass(layout = R.layout.item_timeline_event_base) abstract class MessageImageVideoItem : AbsMessageItem() { @@ -75,7 +76,8 @@ abstract class MessageImageVideoItem : AbsMessageItem { override fun onLoadFailed(e: GlideException?, model: Any?, target: Target?, isFirstResource: Boolean): Boolean { return false @@ -141,8 +141,15 @@ class ImageContentRenderer @Inject constructor(private val localFilesHelper: Loc return false } }) - .dontAnimate() - .transform(RoundedCorners(dimensionConverter.dpToPx(3))) + request = if (animate) { + // Glide seems to already do some dp to px calculation for animated gifs? + request.transform(RoundedCorners(3)) + //request.apply(RequestOptions.bitmapTransform(RoundedCorners(3))) + } else { + request.dontAnimate() + .transform(RoundedCorners(dimensionConverter.dpToPx(3))) + } + request // .thumbnail(0.3f) .into(imageView) }