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

Binary file not shown.

View file

@ -4,7 +4,7 @@ apply plugin: 'kotlin-android-extensions'
static def generateVersionName() {
def gitCount = "git rev-list HEAD --count".execute().text.trim()
// def gitBranch = "git branch".execute().text.trim()
def gitBranch = "git branch".execute().text.trim()
// return gitCount.toInteger() + 831 + " " + gitBranch
return gitCount.toInteger() + 831
}

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

View file

@ -54,7 +54,8 @@
android:layout_width="325dp"
android:layout_height="0dp"
android:layout_weight="1"
android:src="@drawable/tangem_card_2"/>
tools:src="@drawable/card_btc001"
/>
<LinearLayout
android:layout_width="match_parent"
@ -128,7 +129,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
<LinearLayout
@ -264,14 +264,14 @@
android:paddingRight="8dp"
android:visibility="gone">
<TextView
android:id="@+id/lbInputs"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:fontFamily="@font/raleway_r"
android:text="@string/unspents"
android:textColor="@color/primary_dark"
android:textSize="@dimen/text_size_small"/>
<!--<TextView-->
<!--android:id="@+id/lbInputs"-->
<!--android:layout_width="110dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:fontFamily="@font/raleway_r"-->
<!--android:text="@string/unspents"-->
<!--android:textColor="@color/primary_dark"-->
<!--android:textSize="@dimen/text_size_small"/>-->
<TextView
android:id="@+id/tvInputs"