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
296eb5a5
Unverified
Commit
296eb5a5
authored
Sep 06, 2018
by
Lucio Maciel
Committed by
GitHub
Sep 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1653 from RocketChat/fix/image-aspect-ratio
[FIX] Preserves the image aspect ratio
parents
88332df2
638d456c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
Dialog.kt
app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt
+6
-3
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/Dialog.kt
View file @
296eb5a5
...
...
@@ -11,6 +11,9 @@ import com.bumptech.glide.request.target.SimpleTarget
import
com.bumptech.glide.request.transition.Transition
fun
ChatRoomFragment
.
showFileAttachmentDialog
(
uri
:
Uri
)
{
imagePreview
.
isVisible
=
false
audioVideoAttachment
.
isVisible
=
false
textFile
.
isVisible
=
false
var
bitmap
:
Bitmap
?
=
null
activity
?.
let
{
context
->
...
...
@@ -22,16 +25,16 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
.
with
(
context
)
.
asBitmap
()
.
load
(
uri
)
.
override
(
500
,
500
)
.
centerCrop
()
.
override
(
imagePreview
.
width
,
imagePreview
.
height
)
.
fitCenter
()
.
into
(
object
:
SimpleTarget
<
Bitmap
>()
{
override
fun
onResourceReady
(
resource
:
Bitmap
,
transition
:
Transition
<
in
Bitmap
>?
)
{
bitmap
=
resource
imagePreview
.
isVisible
=
true
imagePreview
.
setImageBitmap
(
resource
)
imagePreview
.
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