fix crash when captioning large images (#2149)
This commit is contained in:
parent
0e51953cd4
commit
076a2b248a
1 changed files with 4 additions and 2 deletions
|
@ -101,8 +101,10 @@ fun <T> T.makeCaptionDialog(existingDescription: String?,
|
||||||
// size. Maybe we should limit the size of CustomTarget
|
// size. Maybe we should limit the size of CustomTarget
|
||||||
Glide.with(this)
|
Glide.with(this)
|
||||||
.load(previewUri)
|
.load(previewUri)
|
||||||
.into(object : CustomTarget<Drawable>() {
|
.into(object : CustomTarget<Drawable>(4096, 4096) {
|
||||||
override fun onLoadCleared(placeholder: Drawable?) {}
|
override fun onLoadCleared(placeholder: Drawable?) {
|
||||||
|
imageView.setImageDrawable(placeholder)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>?) {
|
override fun onResourceReady(resource: Drawable, transition: Transition<in Drawable>?) {
|
||||||
imageView.setImageDrawable(resource)
|
imageView.setImageDrawable(resource)
|
||||||
|
|
Loading…
Reference in a new issue