Attachment preview also for Gif files

This commit is contained in:
Benoit Marty 2020-12-01 17:37:06 +01:00 committed by Benoit Marty
parent eb30b9fae9
commit 439029467a
2 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,8 @@
<w>pbkdf</w> <w>pbkdf</w>
<w>pids</w> <w>pids</w>
<w>pkcs</w> <w>pkcs</w>
<w>previewable</w>
<w>previewables</w>
<w>riotx</w> <w>riotx</w>
<w>signin</w> <w>signin</w>
<w>signout</w> <w>signout</w>

View File

@ -18,10 +18,12 @@ package im.vector.app.features.attachments
import org.matrix.android.sdk.api.session.content.ContentAttachmentData import org.matrix.android.sdk.api.session.content.ContentAttachmentData
private val listOfPreviewableMimeTypes = listOf("image/jpeg", "image/png", "image/jpg", "image/gif")
fun ContentAttachmentData.isPreviewable(): Boolean { fun ContentAttachmentData.isPreviewable(): Boolean {
// For now the preview only supports still image // For now the preview only supports still image
return type == ContentAttachmentData.Type.IMAGE return type == ContentAttachmentData.Type.IMAGE
&& listOf("image/jpeg", "image/png", "image/jpg").contains(getSafeMimeType() ?: "") && listOfPreviewableMimeTypes.contains(getSafeMimeType() ?: "")
} }
data class GroupedContentAttachmentData( data class GroupedContentAttachmentData(