mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +03:00
Try to show full image as the fallback of the thumbnail.
This commit is contained in:
parent
319667096f
commit
d09ac8fbce
1 changed files with 17 additions and 0 deletions
|
@ -127,6 +127,23 @@ 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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue