Updated on 2026-08-14
This commit is contained in:
parent
769944959e
commit
1bb12cd0eb
3 changed files with 11 additions and 30 deletions
|
|
@ -20,7 +20,7 @@ public enum Blockchain {
|
|||
Rootstock("RSK", "RBTC", 1.0, R.drawable.tangem2, "RSK"),
|
||||
RootstockToken("RskToken", "RBTC", 1.0, R.drawable.tangem2, "RSK"),
|
||||
Cardano("CARDANO", "ADA", 1000000.0, R.drawable.tangem2, "Cardano"),
|
||||
Ripple ("XRP", "XRP", 1000000.0, R.drawable.ic_logo_xrp, "XRP"),
|
||||
Ripple("XRP", "XRP", 1000000.0, R.drawable.ic_logo_xrp, "XRP"),
|
||||
Binance("BINANCE", "BNB", 100000000.0, R.drawable.ic_logo_binance, "Binance"),
|
||||
BinanceTestNet("BINANCE/test", "BNB", 100000000.0, R.drawable.ic_logo_binance, "Binance Testnet"),
|
||||
Matic("MATIC", "MTX", 1.0, R.drawable.tangem2, "Matic"),
|
||||
|
|
@ -89,37 +89,18 @@ public enum Blockchain {
|
|||
return mImageResource;
|
||||
}
|
||||
|
||||
public int getImageResource(android.content.Context context, String name) {
|
||||
if (name==null || name.isEmpty())
|
||||
return getImageResource();
|
||||
|
||||
name = name.toLowerCase();
|
||||
|
||||
int resourceId = context.getResources().getIdentifier(name + "_token", "drawable", context.getPackageName());
|
||||
|
||||
if (resourceId <= 0)
|
||||
return R.drawable.ic_logo_ethereum;
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public static int getLogoImageResource(String blockchainID, String symbolName) {
|
||||
switch (blockchainID) {
|
||||
case "BTC":
|
||||
return R.drawable.ic_logo_bitcoin;
|
||||
|
||||
case "Token":
|
||||
public int getLogoImageResource(String symbolName) {
|
||||
switch (this) {
|
||||
case Token:
|
||||
if (symbolName.equals("SEED"))
|
||||
return R.drawable.ic_logo_seed;
|
||||
else
|
||||
return R.drawable.ic_logo_ethereum;
|
||||
|
||||
case "ETH":
|
||||
return R.drawable.ic_logo_ethereum;
|
||||
|
||||
case "XLM":
|
||||
return R.drawable.ic_logo_stellar;
|
||||
break;
|
||||
case RootstockToken:
|
||||
if (symbolName.equals("RIF"))
|
||||
return R.drawable.ic_logo_rif;
|
||||
}
|
||||
return R.drawable.tangem2;
|
||||
|
||||
return getImageResource();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ class VerifyCardFragment : BaseFragment(), NavigationResultListener, NfcAdapter.
|
|||
|
||||
tvInputs.text = engine!!.unspentInputsDescription
|
||||
|
||||
ivBlockchain.setImageResource(Blockchain.getLogoImageResource(ctx.card!!.blockchainID, ctx.card!!.tokenSymbol))
|
||||
ivBlockchain.setImageResource(ctx.blockchain.getLogoImageResource(ctx.card!!.tokenSymbol))
|
||||
|
||||
var s = ""
|
||||
for (signingM in ctx.card!!.allowedSigningMethod) {
|
||||
|
|
|
|||
BIN
tangem-sdk-old/src/main/res/drawable/ic_logo_rif.png
Normal file
BIN
tangem-sdk-old/src/main/res/drawable/ic_logo_rif.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Loading…
Add table
Add a link
Reference in a new issue