Updated on 2026-08-14

This commit is contained in:
Tangem 2018-07-05 14:40:09 +03:00
parent 7e618664bf
commit f0817c86ee
11 changed files with 54 additions and 18 deletions

View file

@ -84,4 +84,19 @@ public enum Blockchain {
return R.drawable.ethereum;
return resourceId;
}
public int getLogoImageResource(String tokenSymbol) {
if (Strings.isNullOrEmpty(tokenSymbol))
return getImageResource();
switch (tokenSymbol) {
case "SEED":
return R.drawable.bitcoins;
case "SEEDq":
return R.drawable.bitcoins;
case "SEEDqq":
return R.drawable.bitcoins;
}
return R.drawable.tangem2;
}
}

View file

@ -7,6 +7,7 @@ import com.tangem.domain.cardReader.SettingsMask;
import com.tangem.util.BTCUtils;
import com.tangem.util.FormatUtil;
import com.tangem.util.Util;
import com.tangem.wallet.R;
import java.math.BigInteger;
import java.util.ArrayList;
@ -97,8 +98,6 @@ public class TangemCard {
}
public void setBlockchainID(String blockchainID) {
this.blockchainID = blockchainID;
}
@ -1366,6 +1365,20 @@ public class TangemCard {
countConfirmTX = new BigInteger(B.getString("confirmTx"), 16);
}
public int getCardImageResource() {
switch (getBlockchainID()) {
case "BTC":
return R.drawable.card_btc001;
case "ETH\\XTZ":
return R.drawable.card_seed;
default:
return R.drawable.card_btc001;
}
}
public enum EncryptionMode {
None((byte) 0x0), Fast((byte) 0x1), Strong((byte) 0x2);

View file

@ -70,7 +70,6 @@ import org.json.JSONObject;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Timer;
@ -125,6 +124,7 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
private AppCompatButton btnExtract;
private FloatingActionButton fabInfo;
private Tag lastTag;
private ImageView ivTangemCard;
public LoadedWallet() {
@ -577,12 +577,13 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
View v = inflater.inflate(R.layout.fr_loaded_wallet, container, false);
mSwipeRefreshLayout = v.findViewById(R.id.swipe_container);
ivTangemCard = v.findViewById(R.id.ivTangemCard);
tvBalance = v.findViewById(R.id.tvBalance);
tvOffline = v.findViewById(R.id.tvOffline);
tvCardID = v.findViewById(R.id.tvCardID);
tvWallet = v.findViewById(R.id.tvWallet);
tvInputs = v.findViewById(R.id.tvInputs);
TextView lbInputs = v.findViewById(R.id.lbInputs);
// TextView lbInputs = v.findViewById(R.id.lbInputs);
tvLastOutput = v.findViewById(R.id.tvLastOutput);
tvError = v.findViewById(R.id.tvError);
tvMessage = v.findViewById(R.id.tvMessage);
@ -611,6 +612,11 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
if (mCard.getBlockchain() == Blockchain.Token)
tvBalance.setSingleLine(false);
ivTangemCard.setImageResource(mCard.getCardImageResource());
// Log.i(TAG, "sxnnnnnnnnnnn " + mCard.getBlockchainID());
// Log.i(TAG, "sxnnnnnnnnnnn " + mCard.getTokenSymbol());
// Log.i(TAG, "getDenomination " + Arrays.toString(mCard.getDenomination()));
final CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
boolean visibleFlag = engine != null ? engine.InOutPutVisible() : true;
@ -1029,7 +1035,7 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
verifyCardTask = new VerifyCardTask(getContext(), mCard, mNfcManager, isoDep, this);
verifyCardTask.start();
Log.i(TAG, "onTagDiscovered " + Arrays.toString(tag.getId()));
// Log.i(TAG, "onTagDiscovered " + Arrays.toString(tag.getId()));
} catch (Exception e) {
e.printStackTrace();
@ -1068,7 +1074,7 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
mCardProtocol = cardProtocol;
Log.i(TAG, "scanTimes " + scanTimes);
// Log.i(TAG, "scanTimes " + scanTimes);
if (scanTimes > 0)
openVerifyCard(mCardProtocol);

View file

@ -41,6 +41,7 @@ import java.util.Timer;
import java.util.TimerTask;
public class VerifyCard extends Fragment implements NfcAdapter.ReaderCallback {
public static final String TAG = VerifyCard.class.getSimpleName();
private static final int REQUEST_CODE_SEND_PAYMENT = 1;
private static final int REQUEST_CODE_PURGE = 2;
@ -64,7 +65,6 @@ public class VerifyCard extends Fragment implements NfcAdapter.ReaderCallback {
tvIssuer, tvIssuerData, tvFeatures, tvBlockchain, tvSignedTx, tvSigningMethod, tvFirmware, tvWalletIdentity, tvWallet;
private ImageView ivBlockchain, ivPIN, ivPIN2orSecurityDelay, ivDeveloperVersion;
private SwipeRefreshLayout mSwipeRefreshLayout;
private Tag lastTag;
public VerifyCard() {
@ -383,6 +383,8 @@ public class VerifyCard extends Fragment implements NfcAdapter.ReaderCallback {
ivBlockchain.setImageResource(mCard.getBlockchain().getImageResource(getContext(), mCard.getTokenSymbol()));
Log.i(TAG, "getTokenSymbol " + mCard.getTokenSymbol());
if (mCard.isReusable())
tvReusable.setText(R.string.reusable);
else