mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
Fix fallback to full image.
This commit is contained in:
parent
d09ac8fbce
commit
34c5537436
1 changed files with 12 additions and 17 deletions
|
@ -127,23 +127,18 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
|
||||||
GlideApp
|
GlideApp
|
||||||
.with(imageView)
|
.with(imageView)
|
||||||
.load(resolvedUrl)
|
.load(resolvedUrl)
|
||||||
.listener(object : RequestListener<Drawable> {
|
.apply {
|
||||||
override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
|
contentUrlResolver
|
||||||
return false
|
.resolveFullSize(data.url)
|
||||||
}
|
|
||||||
|
|
||||||
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Drawable>?, isFirstResource: Boolean): Boolean {
|
|
||||||
data.url
|
|
||||||
?.takeIf { it != resolvedUrl }
|
?.takeIf { it != resolvedUrl }
|
||||||
?.let {
|
?.let { fullSizeUrl ->
|
||||||
|
error(
|
||||||
GlideApp
|
GlideApp
|
||||||
.with(imageView)
|
.with(imageView)
|
||||||
.load(it)
|
.load(fullSizeUrl)
|
||||||
return false
|
)
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue