mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Fix fallback to full image.
This commit is contained in:
parent
d09ac8fbce
commit
34c5537436
@ -127,23 +127,18 @@ class ImageContentRenderer @Inject constructor(private val activeSessionHolder:
|
||||
GlideApp
|
||||
.with(imageView)
|
||||
.load(resolvedUrl)
|
||||
.listener(object : RequestListener<Drawable> {
|
||||
override fun onResourceReady(resource: Drawable?, model: Any?, target: Target<Drawable>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Drawable>?, isFirstResource: Boolean): Boolean {
|
||||
data.url
|
||||
?.takeIf { it != resolvedUrl }
|
||||
?.let {
|
||||
GlideApp
|
||||
.with(imageView)
|
||||
.load(it)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
})
|
||||
.apply {
|
||||
contentUrlResolver
|
||||
.resolveFullSize(data.url)
|
||||
?.takeIf { it != resolvedUrl }
|
||||
?.let { fullSizeUrl ->
|
||||
error(
|
||||
GlideApp
|
||||
.with(imageView)
|
||||
.load(fullSizeUrl)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user