Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
a1255c05
Unverified
Commit
a1255c05
authored
Oct 23, 2018
by
Filipe de Lima Brito
Committed by
GitHub
Oct 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1789 from RocketChat/fix/gif-upload
[FIX] Gif files not being animated.
parents
427d6ced
3f640077
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
16 deletions
+27
-16
Dialog.kt
app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt
+27
-16
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt
View file @
a1255c05
...
...
@@ -7,6 +7,7 @@ import androidx.core.view.isVisible
import
chat.rocket.android.emoji.internal.GlideApp
import
chat.rocket.android.util.extensions.getFileName
import
chat.rocket.android.util.extensions.getMimeType
import
com.bumptech.glide.load.resource.gif.GifDrawable
import
com.bumptech.glide.request.target.SimpleTarget
import
com.bumptech.glide.request.transition.Transition
...
...
@@ -21,6 +22,15 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
description
.
text
.
clear
()
when
{
mimeType
.
startsWith
(
"image"
)
->
{
if
(
mimeType
.
contains
(
"gif"
))
{
GlideApp
.
with
(
context
)
.
asGif
()
.
load
(
uri
)
.
override
(
imagePreview
.
width
,
imagePreview
.
height
)
.
fitCenter
()
.
into
(
imagePreview
)
}
else
{
GlideApp
.
with
(
context
)
.
asBitmap
()
...
...
@@ -34,10 +44,11 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
)
{
bitmap
=
resource
imagePreview
.
setImageBitmap
(
resource
)
imagePreview
.
isVisible
=
true
}
})
}
imagePreview
.
isVisible
=
true
}
mimeType
.
startsWith
(
"video"
)
->
audioVideoAttachment
.
isVisible
=
true
else
->
{
textFile
.
isVisible
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment