Unverified Commit 8777fb32 authored by Lucio Maciel's avatar Lucio Maciel Committed by GitHub

Merge branch 'beta' into layout/update-round-icons

parents ac1666f9 296eb5a5
...@@ -11,6 +11,9 @@ import com.bumptech.glide.request.target.SimpleTarget ...@@ -11,6 +11,9 @@ import com.bumptech.glide.request.target.SimpleTarget
import com.bumptech.glide.request.transition.Transition import com.bumptech.glide.request.transition.Transition
fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) { fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
imagePreview.isVisible = false
audioVideoAttachment.isVisible = false
textFile.isVisible = false
var bitmap: Bitmap? = null var bitmap: Bitmap? = null
activity?.let { context -> activity?.let { context ->
...@@ -22,16 +25,16 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) { ...@@ -22,16 +25,16 @@ fun ChatRoomFragment.showFileAttachmentDialog(uri: Uri) {
.with(context) .with(context)
.asBitmap() .asBitmap()
.load(uri) .load(uri)
.override(500, 500) .override(imagePreview.width, imagePreview.height)
.centerCrop() .fitCenter()
.into(object : SimpleTarget<Bitmap>() { .into(object : SimpleTarget<Bitmap>() {
override fun onResourceReady( override fun onResourceReady(
resource: Bitmap, resource: Bitmap,
transition: Transition<in Bitmap>? transition: Transition<in Bitmap>?
) { ) {
bitmap = resource bitmap = resource
imagePreview.isVisible = true
imagePreview.setImageBitmap(resource) imagePreview.setImageBitmap(resource)
imagePreview.isVisible = true
} }
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment