Updated on 2026-08-14

This commit is contained in:
Tangem 2022-11-02 16:03:53 +04:00
parent f6e285825d
commit ff01349bc8
2 changed files with 3 additions and 1 deletions

View file

@ -24,6 +24,7 @@ class CurrencyIconRequest(
private val currencyTextView: TextView?,
private val token: Token?,
private val blockchain: Blockchain,
private val getLocalImage: Boolean = false,
) {
fun load() {
when {
@ -84,7 +85,7 @@ class CurrencyIconRequest(
crossinline onError: (Blockchain) -> Unit = {},
) {
currencyImageView.loadIcon(
data = getIconUrl(blockchain.toNetworkId()),
data = if (getLocalImage) blockchain.getRoundIconRes() else getIconUrl(blockchain.toNetworkId()),
placeholderRes = blockchain.getRoundIconRes(),
onStart = { onStart(blockchain) },
onSuccess = { onSuccess(blockchain) },

View file

@ -68,6 +68,7 @@ fun CurrencyIconView.load(
currencyTextView = null,
token = null,
blockchain = currency.blockchain,
getLocalImage = true,
).load()
}
}