Updated on 2026-08-14

This commit is contained in:
Tangem 2021-05-13 11:53:06 +00:00
commit 4ca7fdddf8
3 changed files with 28 additions and 13 deletions

View file

@ -27,23 +27,31 @@ fun Picasso.loadCurrenciesIcon(
imageView.colorFilter = null
textView.text = null
if (url != null) {
this.load(url)
.placeholder(R.drawable.shape_circle)
?.into(imageView,
object : Callback {
override fun onError(e: Exception?) {
setOfflineCurrencyImage(imageView, textView, token, blockchain)
}
when {
url != null -> {
this.load(url)
.placeholder(R.drawable.shape_circle)
?.into(imageView,
object : Callback {
override fun onError(e: Exception?) {
setOfflineCurrencyImage(imageView, textView, token, blockchain)
}
override fun onSuccess() {
}
})
} else {
setOfflineCurrencyImage(imageView, textView, token, blockchain)
override fun onSuccess() {
}
})
}
token?.symbol == QCX -> {
this.load(R.drawable.ic_qcx)?.into(imageView)
}
else -> {
setOfflineCurrencyImage(imageView, textView, token, blockchain)
}
}
}
private const val QCX = "QCX"
private fun setOfflineCurrencyImage(
imageView: ImageView,
textView: TextView,