Updated on 2026-08-14

This commit is contained in:
Tangem 2019-01-11 09:13:19 +03:00
parent 1b5b0037d1
commit 07bc724ecd
9 changed files with 839 additions and 17 deletions

View file

@ -6,25 +6,24 @@ import com.tangem.tangemcard.R;
* Created by dvol on 06.08.2017.
*/
public enum Blockchain {
Unknown("", "", 1.0, R.drawable.ic_logo_unknown, ""),
Bitcoin("BTC", "BTC", 100000000.0, R.drawable.ic_logo_bitcoin, "Bitcoin"),
BitcoinTestNet("BTC/test", "BTC", 100000000.0, R.drawable.ic_logo_bitcoin_testnet, "Bitcoin Testnet"),
Ethereum("ETH", "ETH", 1.0, R.drawable.ic_logo_ethereum, "Ethereum"),
EthereumTestNet("ETH/test", "ETH", 1.0, R.drawable.ic_logo_ethereum_testnet, "Ethereum Testnet"),
Token("Token", "ERC20", 1.0, R.drawable.ic_logo_bat_token, "Ethereum"),
BitcoinCash("BCH", "BCH", 100000000.0, R.drawable.ic_logo_bitcoin_cash, "Bitcoin Cash"),
Litecoin("LTC", "LTC", 100000000.0, R.drawable.ic_logo_bitcoin, "Litecoin");
Blockchain(String ID, String currency, double multiplier, int imageResource, String officialName) {
Unknown("", "", R.drawable.ic_logo_unknown, ""),
Bitcoin("BTC", "BTC", R.drawable.ic_logo_bitcoin, "Bitcoin"),
BitcoinTestNet("BTC/test", "BTC", R.drawable.ic_logo_bitcoin_testnet, "Bitcoin Testnet"),
Ethereum("ETH", "ETH", R.drawable.ic_logo_ethereum, "Ethereum"),
EthereumTestNet("ETH/test", "ETH", R.drawable.ic_logo_ethereum_testnet, "Ethereum Testnet"),
Token("Token", "ERC20", R.drawable.ic_logo_bat_token, "Ethereum"),
BitcoinCash("BCH", "BCH", R.drawable.ic_logo_bitcoin_cash, "Bitcoin Cash"),
Litecoin("LTC", "LTC", R.drawable.ic_logo_bitcoin, "Litecoin"),
Stellar("XLM", "XLM", R.drawable.ic_logo_stellar, "Stellar Lumens"),
StellarTestNet("XLM/test", "XLM", R.drawable.ic_logo_bitcoin, "Stellar Lumens");
Blockchain(String ID, String currency, int imageResource, String officialName) {
mID = ID;
mCurrency = currency;
// mMultiplier = multiplier;
mImageResource = imageResource;
mOfficialName = officialName;
}
private String mID, mOfficialName;
//private double mMultiplier;
private String mCurrency;
private int mImageResource;
@ -36,10 +35,6 @@ public enum Blockchain {
return mOfficialName;
}
// public double getMultiplier() {
// return mMultiplier;
// }
public String getCurrency() {
return mCurrency;
}
@ -83,6 +78,7 @@ public enum Blockchain {
return resourceId;
}
//TODO - ???
public static int getLogoImageResource(String blockchainID, String symbolName) {
switch (blockchainID) {
case "BTC":
@ -96,6 +92,9 @@ public enum Blockchain {
case "ETH":
return R.drawable.ic_logo_ethereum;
case "XLM":
return R.drawable.ic_logo_stellar;
}
return R.drawable.tangem2;
}