mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-23 22:39:02 +03:00
Attachment preview also for Gif files
This commit is contained in:
parent
eb30b9fae9
commit
439029467a
2 changed files with 5 additions and 1 deletions
.idea/dictionaries
vector/src/main/java/im/vector/app/features/attachments
2
.idea/dictionaries/bmarty.xml
generated
2
.idea/dictionaries/bmarty.xml
generated
|
@ -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>
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Loading…
Add table
Reference in a new issue