Updated on 2026-08-14
This commit is contained in:
parent
a0b512e2c0
commit
0e4c0349de
1 changed files with 11 additions and 6 deletions
|
|
@ -52,9 +52,6 @@ class CurrencyIconRequest(
|
|||
|
||||
private fun loadTokenIcon() {
|
||||
loadTokenIconBase(
|
||||
onStart = {
|
||||
currencyImageView.setColorFilter(it.getColor())
|
||||
},
|
||||
onSuccess = {
|
||||
currencyImageView.colorFilter = null
|
||||
}
|
||||
|
|
@ -94,17 +91,25 @@ class CurrencyIconRequest(
|
|||
data = getTokenIcon(token, blockchain),
|
||||
placeholderRes = R.drawable.shape_circle,
|
||||
onStart = {
|
||||
currencyTextView.text = token.symbol.take(1)
|
||||
currencyTextView.setTextColor(token.getTextColor())
|
||||
showPlaceholder(token)
|
||||
onStart(token)
|
||||
},
|
||||
onSuccess = {
|
||||
currencyTextView.text = null
|
||||
onSuccess(token)
|
||||
},
|
||||
onError = { onError(token) },
|
||||
onError = {
|
||||
showPlaceholder(token)
|
||||
onError(token)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
private fun showPlaceholder(token: Token) {
|
||||
currencyTextView.text = token.symbol.take(1)
|
||||
currencyTextView.setTextColor(token.getTextColor())
|
||||
currencyImageView.setColorFilter(token.getColor())
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun ImageView.loadIcon(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue