Updated on 2026-08-14
This commit is contained in:
parent
d71ee3f4d5
commit
cc71c599f7
6 changed files with 315 additions and 313 deletions
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
|
|
@ -3,6 +3,8 @@ package com.tangem.presentation.adapter;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v7.widget.CardView;
|
import android.support.v7.widget.CardView;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
@ -31,12 +33,16 @@ import static com.tangem.domain.wallet.TangemCard.CountOurTx;
|
||||||
|
|
||||||
public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardViewHolder> {
|
public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardViewHolder> {
|
||||||
|
|
||||||
public static class CardViewHolder extends RecyclerView.ViewHolder {
|
public interface UiCallbacks {
|
||||||
CardView cv;
|
void onViewCard(Bundle cardInfo);
|
||||||
TextView tvBalance, tvOffline, tvBalanceEquivalent, tvWallet, tvInputs, tvStatusInBlockchain, tvCardID, tvLastInput, lbLastInput, lbLastOutput, tvLastOutput, tvBlockchain;
|
}
|
||||||
TextView tvType, tvTypeBg, tvVoid;
|
|
||||||
ImageView imgBlockchain, imgSecurityNotification;
|
static class CardViewHolder extends RecyclerView.ViewHolder {
|
||||||
View llCardLoaded, llCardEmpty, llCardError, llCardPurged;
|
private CardView cv;
|
||||||
|
private TextView tvBalance, tvOffline, tvBalanceEquivalent, tvWallet, tvInputs, tvStatusInBlockchain, tvCardID, tvLastInput, lbLastInput, lbLastOutput, tvLastOutput, tvBlockchain;
|
||||||
|
private TextView tvType, tvTypeBg, tvVoid;
|
||||||
|
private ImageView imgBlockchain, imgSecurityNotification;
|
||||||
|
private View llCardLoaded, llCardEmpty, llCardError, llCardPurged;
|
||||||
|
|
||||||
CardViewHolder(View itemView) {
|
CardViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
|
@ -46,23 +52,15 @@ public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardVi
|
||||||
tvBalanceEquivalent = itemView.findViewById(R.id.tvBalanceEquivalent);
|
tvBalanceEquivalent = itemView.findViewById(R.id.tvBalanceEquivalent);
|
||||||
tvWallet = itemView.findViewById(R.id.tvWallet);
|
tvWallet = itemView.findViewById(R.id.tvWallet);
|
||||||
tvCardID = itemView.findViewById(R.id.tvCardID);
|
tvCardID = itemView.findViewById(R.id.tvCardID);
|
||||||
|
if (tvCardID != null) tvCardID.requestFocus();
|
||||||
tvType = itemView.findViewById(R.id.tvType);
|
tvType = itemView.findViewById(R.id.tvType);
|
||||||
tvTypeBg = itemView.findViewById(R.id.tvTypeBg);
|
tvTypeBg = itemView.findViewById(R.id.tvTypeBg);
|
||||||
tvVoid = itemView.findViewById(R.id.tvVoid);
|
tvVoid = itemView.findViewById(R.id.tvVoid);
|
||||||
|
|
||||||
if (tvCardID != null) {
|
|
||||||
tvCardID.requestFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
tvInputs = itemView.findViewById(R.id.tvInputs);
|
tvInputs = itemView.findViewById(R.id.tvInputs);
|
||||||
|
|
||||||
tvLastInput = itemView.findViewById(R.id.tvLastInput);
|
tvLastInput = itemView.findViewById(R.id.tvLastInput);
|
||||||
lbLastInput = itemView.findViewById(R.id.lbLastInput);
|
lbLastInput = itemView.findViewById(R.id.lbLastInput);
|
||||||
|
|
||||||
lbLastOutput = itemView.findViewById(R.id.lbLastOutput);
|
lbLastOutput = itemView.findViewById(R.id.lbLastOutput);
|
||||||
tvLastOutput = itemView.findViewById(R.id.tvLastOutput);
|
tvLastOutput = itemView.findViewById(R.id.tvLastOutput);
|
||||||
|
|
||||||
tvBlockchain = itemView.findViewById(R.id.tvBlockchain);
|
tvBlockchain = itemView.findViewById(R.id.tvBlockchain);
|
||||||
imgBlockchain = itemView.findViewById(R.id.imgBlockchain);
|
imgBlockchain = itemView.findViewById(R.id.imgBlockchain);
|
||||||
llCardLoaded = itemView.findViewById(R.id.cardLoaded);
|
llCardLoaded = itemView.findViewById(R.id.cardLoaded);
|
||||||
|
|
@ -73,10 +71,6 @@ public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardVi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface UiCallbacks {
|
|
||||||
void onViewCard(Bundle cardInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
private LayoutInflater mLayoutInflater;
|
private LayoutInflater mLayoutInflater;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private UiCallbacks mUiCallbacks;
|
private UiCallbacks mUiCallbacks;
|
||||||
|
|
@ -101,9 +95,232 @@ public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardVi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mCards == null ? 0 : mCards.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public CardViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_list_card, parent, false);
|
||||||
|
CardViewHolder cvh = new CardViewHolder(v);
|
||||||
|
return cvh;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull CardViewHolder holder, int position) {
|
||||||
|
try {
|
||||||
|
TangemCard card = mCards.get(position);
|
||||||
|
CoinEngine engine = CoinEngineFactory.Create(card.getBlockchain());
|
||||||
|
int color = android.R.color.black;
|
||||||
|
switch (card.getStatus()) {
|
||||||
|
case NotPersonalized:
|
||||||
|
color = R.color.card_state_error;
|
||||||
|
holder.llCardError.setVisibility(View.VISIBLE);
|
||||||
|
holder.llCardLoaded.setVisibility(View.GONE);
|
||||||
|
holder.llCardEmpty.setVisibility(View.GONE);
|
||||||
|
holder.llCardPurged.setVisibility(View.GONE);
|
||||||
|
holder.imgBlockchain.setVisibility(View.INVISIBLE);
|
||||||
|
holder.imgSecurityNotification.setVisibility(View.INVISIBLE);
|
||||||
|
holder.tvCardID.setVisibility(View.INVISIBLE);
|
||||||
|
holder.tvCardID.setError(null);
|
||||||
|
holder.tvType.setVisibility(View.INVISIBLE);
|
||||||
|
holder.tvTypeBg.setVisibility(View.INVISIBLE);
|
||||||
|
holder.tvVoid.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Empty:
|
||||||
|
color = R.color.card_state_empty;
|
||||||
|
holder.llCardEmpty.setVisibility(View.VISIBLE);
|
||||||
|
holder.llCardLoaded.setVisibility(View.GONE);
|
||||||
|
holder.llCardError.setVisibility(View.GONE);
|
||||||
|
holder.llCardPurged.setVisibility(View.GONE);
|
||||||
|
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
||||||
|
if (card.getBlockchain() != null) {
|
||||||
|
holder.imgBlockchain.setImageResource(card.getBlockchain().getImageResource(this.mContext, card.getTokenSymbol()));
|
||||||
|
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
holder.imgBlockchain.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
if (card.useDefaultPIN1() || card.useDefaultPIN2() || card.getPauseBeforePIN2() > 0 || card.useDevelopersFirmware()) {
|
||||||
|
//holder.imgSecurityNotification.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
holder.imgSecurityNotification.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
holder.tvCardID.setText(card.getCIDDescription());
|
||||||
|
holder.tvCardID.setError(null);
|
||||||
|
holder.tvCardID.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
holder.tvType.setVisibility(View.VISIBLE);
|
||||||
|
holder.tvTypeBg.setVisibility(View.VISIBLE);
|
||||||
|
if (card.isReusable()) {
|
||||||
|
holder.tvType.setText(R.string.reusable_reusable);
|
||||||
|
holder.tvTypeBg.setBackgroundColor(ContextCompat.getColor(mContext, R.color.type_wallet));
|
||||||
|
} else {
|
||||||
|
holder.tvType.setText(R.string.banknote_banknote);
|
||||||
|
holder.tvTypeBg.setBackgroundColor(ContextCompat.getColor(mContext, R.color.type_banknote));
|
||||||
|
}
|
||||||
|
holder.tvVoid.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Purged:
|
||||||
|
color = R.color.card_state_purged;
|
||||||
|
holder.llCardEmpty.setVisibility(View.GONE);
|
||||||
|
holder.llCardLoaded.setVisibility(View.GONE);
|
||||||
|
holder.llCardError.setVisibility(View.GONE);
|
||||||
|
holder.llCardPurged.setVisibility(View.VISIBLE);
|
||||||
|
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
||||||
|
if (card.getBlockchain() != null) {
|
||||||
|
holder.imgBlockchain.setImageResource(card.getBlockchain().getImageResource(this.mContext, card.getTokenSymbol()));
|
||||||
|
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
||||||
|
} else
|
||||||
|
holder.imgBlockchain.setVisibility(View.INVISIBLE);
|
||||||
|
holder.imgSecurityNotification.setVisibility(View.INVISIBLE);
|
||||||
|
holder.tvCardID.setText(card.getCIDDescription());
|
||||||
|
holder.tvCardID.setVisibility(View.VISIBLE);
|
||||||
|
holder.tvCardID.setError(null);
|
||||||
|
holder.tvType.setVisibility(View.VISIBLE);
|
||||||
|
holder.tvTypeBg.setVisibility(View.VISIBLE);
|
||||||
|
holder.tvType.setText(R.string.banknote_banknote);
|
||||||
|
holder.tvTypeBg.setBackgroundColor(ContextCompat.getColor(mContext, R.color.type_banknote));
|
||||||
|
holder.tvVoid.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Loaded:
|
||||||
|
holder.llCardLoaded.setVisibility(View.VISIBLE);
|
||||||
|
holder.llCardError.setVisibility(View.GONE);
|
||||||
|
holder.llCardEmpty.setVisibility(View.GONE);
|
||||||
|
holder.llCardPurged.setVisibility(View.GONE);
|
||||||
|
holder.tvCardID.setText(card.getCIDDescription());
|
||||||
|
holder.tvCardID.setVisibility(View.VISIBLE);
|
||||||
|
holder.tvWallet.setText(card.getShortWalletString());
|
||||||
|
holder.tvBlockchain.setText(card.getBlockchainName());
|
||||||
|
|
||||||
|
if (card.getBlockchain() != null) {
|
||||||
|
holder.imgBlockchain.setImageResource(card.getBlockchain().getImageResource(this.mContext, card.getTokenSymbol()));
|
||||||
|
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
holder.imgBlockchain.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!engine.HasBalanceInfo(card)) {
|
||||||
|
color = R.color.card_state_loaded;
|
||||||
|
} else if (engine.IsBalanceNotZero(card)) {
|
||||||
|
color = R.color.card_state_loaded_with_coins;
|
||||||
|
} else {
|
||||||
|
color = R.color.card_state_loaded_with_zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (holder.tvStatusInBlockchain != null) {
|
||||||
|
if (card.hasBalanceInfo() && card.hasUnspentInfo() && card.getUnspentTransactions().size() > 0) {
|
||||||
|
holder.tvStatusInBlockchain.setText(R.string.ok);
|
||||||
|
holder.tvStatusInBlockchain.setTextColor(ContextCompat.getColor(mContext, R.color.confirmed));
|
||||||
|
} else if (!card.hasBalanceInfo() || !card.hasUnspentInfo()) {
|
||||||
|
holder.tvStatusInBlockchain.setText(R.string.no_data_string);
|
||||||
|
holder.tvStatusInBlockchain.setTextColor(ContextCompat.getColor(mContext, R.color.primary_dark));
|
||||||
|
} else {
|
||||||
|
holder.tvStatusInBlockchain.setText(R.string.not_found);
|
||||||
|
holder.tvStatusInBlockchain.setTextColor(ContextCompat.getColor(mContext, R.color.not_confirmed));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (engine.HasBalanceInfo(card) || card.getOfflineBalance() == null) {
|
||||||
|
String balance = engine.GetBalance(card);
|
||||||
|
holder.tvBalance.setText(balance);
|
||||||
|
holder.tvBalanceEquivalent.setText(engine.GetBalanceEquivalent(card));
|
||||||
|
holder.tvBalance.setTextColor(Color.BLACK);
|
||||||
|
holder.tvOffline.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
String offlineAmount = engine.ConvertByteArrayToAmount(card, card.getOfflineBalance());
|
||||||
|
holder.tvBalance.setText(engine.GetAmountDescription(card, offlineAmount));
|
||||||
|
holder.tvBalanceEquivalent.setText(engine.GetAmountEqualentDescriptor(card, offlineAmount));
|
||||||
|
holder.tvOffline.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
if (!card.getAmountEquivalentDescriptionAvailable()) {
|
||||||
|
//holder.tvBalanceEquivalent.setError("Service unavailable");
|
||||||
|
} else {
|
||||||
|
holder.tvBalanceEquivalent.setError(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
String error = card.getError();
|
||||||
|
//holder.tvCardID.setError(error);
|
||||||
|
|
||||||
|
if (holder.tvInputs != null) {
|
||||||
|
holder.tvInputs.setText(card.getInputsDescription());
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean visibleFlag = engine != null ? engine.InOutPutVisible() : true;
|
||||||
|
int visibleIOPuts = visibleFlag ? View.VISIBLE : View.GONE;
|
||||||
|
if (holder.tvLastInput != null) {
|
||||||
|
holder.tvLastInput.setText(card.getLastInputDescription());
|
||||||
|
if (card.getLastInputDescription().contains("awaiting"))
|
||||||
|
holder.tvLastInput.setTextColor(ContextCompat.getColor(mContext, R.color.not_confirmed));
|
||||||
|
else if (card.getLastInputDescription().contains("None") || card.getLastInputDescription().contains("--"))
|
||||||
|
holder.tvLastInput.setTextColor(ContextCompat.getColor(mContext, R.color.primary_dark));
|
||||||
|
else
|
||||||
|
holder.tvLastInput.setTextColor(ContextCompat.getColor(mContext, R.color.confirmed));
|
||||||
|
|
||||||
|
holder.tvLastInput.setVisibility(visibleIOPuts);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (holder.lbLastInput != null) {
|
||||||
|
holder.lbLastInput.setVisibility(visibleIOPuts);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (holder.tvLastOutput != null) {
|
||||||
|
holder.tvLastOutput.setText(card.getLastOutputDescription());
|
||||||
|
holder.tvLastOutput.setVisibility(visibleIOPuts);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (holder.lbLastOutput != null) {
|
||||||
|
holder.lbLastOutput.setVisibility(visibleIOPuts);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (card.useDefaultPIN1() || card.useDefaultPIN2() || card.getPauseBeforePIN2() > 0 || card.useDevelopersFirmware()) {
|
||||||
|
// holder.imgSecurityNotification.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
holder.imgSecurityNotification.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.tvType.setVisibility(View.VISIBLE);
|
||||||
|
holder.tvTypeBg.setVisibility(View.VISIBLE);
|
||||||
|
if (card.isReusable()) {
|
||||||
|
holder.tvType.setText(R.string.reusable_reusable);
|
||||||
|
holder.tvTypeBg.setBackgroundColor(ContextCompat.getColor(mContext, R.color.type_wallet));
|
||||||
|
holder.tvVoid.setVisibility(View.INVISIBLE);
|
||||||
|
} else {
|
||||||
|
holder.tvType.setText(R.string.banknote_banknote);
|
||||||
|
if (card.getRemainingSignatures() != card.getMaxSignatures()) {
|
||||||
|
holder.tvVoid.setVisibility(View.VISIBLE);
|
||||||
|
holder.tvTypeBg.setBackgroundColor(ContextCompat.getColor(mContext, R.color.msg_err));
|
||||||
|
} else {
|
||||||
|
holder.tvVoid.setVisibility(View.INVISIBLE);
|
||||||
|
holder.tvTypeBg.setBackgroundColor(ContextCompat.getColor(mContext, R.color.type_banknote));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (card.useDevelopersFirmware()) {
|
||||||
|
holder.tvType.setText(R.string.developer_kit);
|
||||||
|
holder.tvTypeBg.setBackgroundColor(ContextCompat.getColor(mContext, R.color.fab));
|
||||||
|
holder.tvVoid.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.cv.setOnClickListener(new CardClickListener(position));
|
||||||
|
holder.cv.setCardBackgroundColor(mContext.getResources().getColor(color));
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e("onBindViewHolder", e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void onSaveInstanceState(Bundle outstate) {
|
public void onSaveInstanceState(Bundle outstate) {
|
||||||
ArrayList<String> UIDs = new ArrayList<String>(mCards.size());
|
ArrayList<String> UIDs = new ArrayList<>(mCards.size());
|
||||||
for (TangemCard card : mCards) {
|
for (TangemCard card : mCards) {
|
||||||
Bundle B = new Bundle();
|
Bundle B = new Bundle();
|
||||||
card.SaveToBundle(B);
|
card.SaveToBundle(B);
|
||||||
|
|
@ -154,7 +371,6 @@ public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardVi
|
||||||
removeCard(i);
|
removeCard(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateCard(TangemCard card) {
|
public void updateCard(TangemCard card) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < mCards.size(); i++) {
|
for (i = 0; i < mCards.size(); i++) {
|
||||||
|
|
@ -185,7 +401,6 @@ public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardVi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void UpdateWalletCoutConfirmTx(String walletAddress, BigInteger nonce) {
|
public void UpdateWalletCoutConfirmTx(String walletAddress, BigInteger nonce) {
|
||||||
for (TangemCard c : mCards) {
|
for (TangemCard c : mCards) {
|
||||||
if (c.getWallet().equals(walletAddress)) {
|
if (c.getWallet().equals(walletAddress)) {
|
||||||
|
|
@ -287,9 +502,7 @@ public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardVi
|
||||||
if (c.getWallet().equals(walletAddress)) {
|
if (c.getWallet().equals(walletAddress)) {
|
||||||
try {
|
try {
|
||||||
c.getHaedersInfo();
|
c.getHaedersInfo();
|
||||||
c.UpdateHeaderInfo(new TangemCard.HeaderInfo(
|
c.UpdateHeaderInfo(new TangemCard.HeaderInfo(jsHeader.getInt("block_height"), jsHeader.getInt("timestamp")));
|
||||||
jsHeader.getInt("block_height"),
|
|
||||||
jsHeader.getInt("timestamp")));
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
@ -353,237 +566,9 @@ public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardVi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return mCards == null ? 0 : mCards.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CardViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
|
||||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_list_card, parent, false);
|
|
||||||
CardViewHolder cvh = new CardViewHolder(v);
|
|
||||||
return cvh;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(CardViewHolder holder, int position) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
TangemCard card = mCards.get(position);
|
|
||||||
CoinEngine engine = CoinEngineFactory.Create(card.getBlockchain());
|
|
||||||
|
|
||||||
int color = android.R.color.black;
|
|
||||||
|
|
||||||
switch (card.getStatus()) {
|
|
||||||
case NotPersonalized:
|
|
||||||
color = R.color.card_state_error;
|
|
||||||
holder.llCardError.setVisibility(View.VISIBLE);
|
|
||||||
holder.llCardLoaded.setVisibility(View.GONE);
|
|
||||||
holder.llCardEmpty.setVisibility(View.GONE);
|
|
||||||
holder.llCardPurged.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
holder.imgBlockchain.setVisibility(View.INVISIBLE);
|
|
||||||
holder.imgSecurityNotification.setVisibility(View.INVISIBLE);
|
|
||||||
holder.tvCardID.setVisibility(View.INVISIBLE);
|
|
||||||
holder.tvCardID.setError(null);
|
|
||||||
|
|
||||||
holder.tvType.setVisibility(View.INVISIBLE);
|
|
||||||
holder.tvTypeBg.setVisibility(View.INVISIBLE);
|
|
||||||
holder.tvVoid.setVisibility(View.INVISIBLE);
|
|
||||||
break;
|
|
||||||
case Empty:
|
|
||||||
color = R.color.card_state_empty;
|
|
||||||
holder.llCardEmpty.setVisibility(View.VISIBLE);
|
|
||||||
holder.llCardLoaded.setVisibility(View.GONE);
|
|
||||||
holder.llCardError.setVisibility(View.GONE);
|
|
||||||
holder.llCardPurged.setVisibility(View.GONE);
|
|
||||||
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
|
||||||
if (card.getBlockchain() != null) {
|
|
||||||
holder.imgBlockchain.setImageResource(card.getBlockchain().getImageResource(this.mContext, card.getTokenSymbol()));
|
|
||||||
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
holder.imgBlockchain.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
if (card.useDefaultPIN1() || card.useDefaultPIN2() || card.getPauseBeforePIN2() > 0 || card.useDevelopersFirmware()) {
|
|
||||||
//holder.imgSecurityNotification.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
holder.imgSecurityNotification.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
holder.tvCardID.setText(card.getCIDDescription());
|
|
||||||
holder.tvCardID.setError(null);
|
|
||||||
holder.tvCardID.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
holder.tvType.setVisibility(View.VISIBLE);
|
|
||||||
holder.tvTypeBg.setVisibility(View.VISIBLE);
|
|
||||||
if (card.isReusable()) {
|
|
||||||
holder.tvType.setText(" REUSABLE REUSABLE ");
|
|
||||||
holder.tvTypeBg.setBackgroundColor(mContext.getResources().getColor(R.color.type_wallet, mContext.getTheme()));
|
|
||||||
} else {
|
|
||||||
holder.tvType.setText(" BANKNOTE BANKNOTE");
|
|
||||||
holder.tvTypeBg.setBackgroundColor(mContext.getResources().getColor(R.color.type_banknote, mContext.getTheme()));
|
|
||||||
}
|
|
||||||
holder.tvVoid.setVisibility(View.INVISIBLE);
|
|
||||||
break;
|
|
||||||
case Purged:
|
|
||||||
color = R.color.card_state_purged;
|
|
||||||
holder.llCardEmpty.setVisibility(View.GONE);
|
|
||||||
holder.llCardLoaded.setVisibility(View.GONE);
|
|
||||||
holder.llCardError.setVisibility(View.GONE);
|
|
||||||
holder.llCardPurged.setVisibility(View.VISIBLE);
|
|
||||||
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
|
||||||
if (card.getBlockchain() != null) {
|
|
||||||
holder.imgBlockchain.setImageResource(card.getBlockchain().getImageResource(this.mContext, card.getTokenSymbol()));
|
|
||||||
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
holder.imgBlockchain.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
holder.imgSecurityNotification.setVisibility(View.INVISIBLE);
|
|
||||||
holder.tvCardID.setText(card.getCIDDescription());
|
|
||||||
holder.tvCardID.setVisibility(View.VISIBLE);
|
|
||||||
holder.tvCardID.setError(null);
|
|
||||||
holder.tvType.setVisibility(View.VISIBLE);
|
|
||||||
holder.tvTypeBg.setVisibility(View.VISIBLE);
|
|
||||||
holder.tvType.setText(" BANKNOTE BANKNOTE");
|
|
||||||
holder.tvTypeBg.setBackgroundColor(mContext.getResources().getColor(R.color.type_banknote, mContext.getTheme()));
|
|
||||||
holder.tvVoid.setVisibility(View.INVISIBLE);
|
|
||||||
break;
|
|
||||||
case Loaded:
|
|
||||||
holder.llCardLoaded.setVisibility(View.VISIBLE);
|
|
||||||
holder.llCardError.setVisibility(View.GONE);
|
|
||||||
holder.llCardEmpty.setVisibility(View.GONE);
|
|
||||||
holder.llCardPurged.setVisibility(View.GONE);
|
|
||||||
holder.tvCardID.setText(card.getCIDDescription());
|
|
||||||
holder.tvCardID.setVisibility(View.VISIBLE);
|
|
||||||
holder.tvWallet.setText(card.getShortWalletString());
|
|
||||||
|
|
||||||
holder.tvBlockchain.setText(card.getBlockchainName());
|
|
||||||
|
|
||||||
if (card.getBlockchain() != null) {
|
|
||||||
holder.imgBlockchain.setImageResource(card.getBlockchain().getImageResource(this.mContext, card.getTokenSymbol()));
|
|
||||||
holder.imgBlockchain.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
holder.imgBlockchain.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!engine.HasBalanceInfo(card)) {
|
|
||||||
color = R.color.card_state_loaded;
|
|
||||||
} else if (engine.IsBalanceNotZero(card)) {
|
|
||||||
color = R.color.card_state_loaded_with_coins;
|
|
||||||
} else {
|
|
||||||
color = R.color.card_state_loaded_with_zero;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (holder.tvStatusInBlockchain != null) {
|
|
||||||
if (card.hasBalanceInfo() && card.hasUnspentInfo() && card.getUnspentTransactions().size() > 0) {
|
|
||||||
holder.tvStatusInBlockchain.setText("Ok");
|
|
||||||
holder.tvStatusInBlockchain.setTextColor(mContext.getResources().getColor(R.color.confirmed, mContext.getTheme()));
|
|
||||||
} else if (!card.hasBalanceInfo() || !card.hasUnspentInfo()) {
|
|
||||||
holder.tvStatusInBlockchain.setText("-- -- --");
|
|
||||||
holder.tvStatusInBlockchain.setTextColor(mContext.getResources().getColor(R.color.primary_dark, mContext.getTheme()));
|
|
||||||
} else {
|
|
||||||
holder.tvStatusInBlockchain.setText("Not found");
|
|
||||||
holder.tvStatusInBlockchain.setTextColor(mContext.getResources().getColor(R.color.not_confirmed, mContext.getTheme()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (engine.HasBalanceInfo(card) || card.getOfflineBalance() == null) {
|
|
||||||
String balance = engine.GetBalance(card);
|
|
||||||
holder.tvBalance.setText(balance);
|
|
||||||
holder.tvBalanceEquivalent.setText(engine.GetBalanceEquivalent(card));
|
|
||||||
holder.tvBalance.setTextColor(Color.BLACK);
|
|
||||||
holder.tvOffline.setVisibility(View.INVISIBLE);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
String offlineAmount = engine.ConvertByteArrayToAmount(card, card.getOfflineBalance());
|
|
||||||
holder.tvBalance.setText(engine.GetAmountDescription(card, offlineAmount));
|
|
||||||
holder.tvBalanceEquivalent.setText(engine.GetAmountEqualentDescriptor(card, offlineAmount));
|
|
||||||
holder.tvOffline.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
if (!card.getAmountEquivalentDescriptionAvailable()) {
|
|
||||||
//holder.tvBalanceEquivalent.setError("Service unavailable");
|
|
||||||
} else {
|
|
||||||
holder.tvBalanceEquivalent.setError(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
String error = card.getError();
|
|
||||||
//holder.tvCardID.setError(error);
|
|
||||||
|
|
||||||
if (holder.tvInputs != null) {
|
|
||||||
holder.tvInputs.setText(card.getInputsDescription());
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean visibleFlag = engine != null ? engine.InOutPutVisible() : true;
|
|
||||||
int visibleIOPuts = visibleFlag ? View.VISIBLE : View.GONE;
|
|
||||||
if (holder.tvLastInput != null) {
|
|
||||||
holder.tvLastInput.setText(card.getLastInputDescription());
|
|
||||||
if (card.getLastInputDescription().contains("awaiting")) {
|
|
||||||
holder.tvLastInput.setTextColor(mContext.getResources().getColor(R.color.not_confirmed, mContext.getTheme()));
|
|
||||||
} else if (card.getLastInputDescription().contains("None") || card.getLastInputDescription().contains("--")) {
|
|
||||||
holder.tvLastInput.setTextColor(mContext.getResources().getColor(R.color.primary_dark, mContext.getTheme()));
|
|
||||||
} else {
|
|
||||||
holder.tvLastInput.setTextColor(mContext.getResources().getColor(R.color.confirmed, mContext.getTheme()));
|
|
||||||
}
|
|
||||||
holder.tvLastInput.setVisibility(visibleIOPuts);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (holder.lbLastInput != null) {
|
|
||||||
holder.lbLastInput.setVisibility(visibleIOPuts);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (holder.tvLastOutput != null) {
|
|
||||||
holder.tvLastOutput.setText(card.getLastOutputDescription());
|
|
||||||
holder.tvLastOutput.setVisibility(visibleIOPuts);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (holder.lbLastOutput != null) {
|
|
||||||
holder.lbLastOutput.setVisibility(visibleIOPuts);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (card.useDefaultPIN1() || card.useDefaultPIN2() || card.getPauseBeforePIN2() > 0 || card.useDevelopersFirmware()) {
|
|
||||||
//holder.imgSecurityNotification.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
|
||||||
holder.imgSecurityNotification.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.tvType.setVisibility(View.VISIBLE);
|
|
||||||
holder.tvTypeBg.setVisibility(View.VISIBLE);
|
|
||||||
if (card.isReusable()) {
|
|
||||||
holder.tvType.setText(" REUSABLE REUSABLE ");
|
|
||||||
holder.tvTypeBg.setBackgroundColor(mContext.getResources().getColor(R.color.type_wallet, mContext.getTheme()));
|
|
||||||
holder.tvVoid.setVisibility(View.INVISIBLE);
|
|
||||||
} else {
|
|
||||||
holder.tvType.setText(" BANKNOTE BANKNOTE");
|
|
||||||
|
|
||||||
if (card.getRemainingSignatures() != card.getMaxSignatures()) {
|
|
||||||
holder.tvVoid.setVisibility(View.VISIBLE);
|
|
||||||
holder.tvTypeBg.setBackgroundColor(mContext.getResources().getColor(R.color.msg_err, mContext.getTheme()));
|
|
||||||
} else {
|
|
||||||
holder.tvVoid.setVisibility(View.INVISIBLE);
|
|
||||||
holder.tvTypeBg.setBackgroundColor(mContext.getResources().getColor(R.color.type_banknote, mContext.getTheme()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (card.useDevelopersFirmware()) {
|
|
||||||
holder.tvType.setText(" DEVELOPER KIT ");
|
|
||||||
holder.tvTypeBg.setBackgroundColor(mContext.getResources().getColor(R.color.fab, mContext.getTheme()));
|
|
||||||
holder.tvVoid.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
holder.cv.setOnClickListener(new CardClickListener(position));
|
|
||||||
holder.cv.setCardBackgroundColor(mContext.getResources().getColor(color));
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.e("onBindViewHolder", e.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class CardClickListener implements View.OnClickListener {
|
private class CardClickListener implements View.OnClickListener {
|
||||||
TangemCard card;
|
private TangemCard card;
|
||||||
int pos;
|
private int pos;
|
||||||
|
|
||||||
CardClickListener(int position) {
|
CardClickListener(int position) {
|
||||||
card = mCards.get(position);
|
card = mCards.get(position);
|
||||||
|
|
@ -600,4 +585,5 @@ public class CardListAdapter extends RecyclerView.Adapter<CardListAdapter.CardVi
|
||||||
mUiCallbacks.onViewCard(b);
|
mUiCallbacks.onViewCard(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -111,6 +111,7 @@ public class MainFragment extends Fragment implements NfcAdapter.ReaderCallback,
|
||||||
progressBar = result.findViewById(R.id.progressBar);
|
progressBar = result.findViewById(R.id.progressBar);
|
||||||
progressBar.setProgressTintList(ColorStateList.valueOf(Color.DKGRAY));
|
progressBar.setProgressTintList(ColorStateList.valueOf(Color.DKGRAY));
|
||||||
RecyclerView rvCards = result.findViewById(R.id.lvCards);
|
RecyclerView rvCards = result.findViewById(R.id.lvCards);
|
||||||
|
|
||||||
rvCards.setLayoutManager(new LinearLayoutManager(getContext()));
|
rvCards.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
mCardListAdapter = new CardListAdapter(getActivity().getLayoutInflater(), savedInstanceState, this);
|
mCardListAdapter = new CardListAdapter(getActivity().getLayoutInflater(), savedInstanceState, this);
|
||||||
rvCards.setAdapter(mCardListAdapter);
|
rvCards.setAdapter(mCardListAdapter);
|
||||||
|
|
@ -218,7 +219,6 @@ public class MainFragment extends Fragment implements NfcAdapter.ReaderCallback,
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
mNfcManager.onResume();
|
mNfcManager.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
android:id="@+id/cvCard"
|
android:id="@+id/cvCard"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/card_height"
|
android:layout_height="@dimen/card_height"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginBottom="0dp"
|
android:layout_marginBottom="0dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
|
|
@ -15,7 +14,8 @@
|
||||||
card_view:cardCornerRadius="6dp"
|
card_view:cardCornerRadius="6dp"
|
||||||
card_view:cardElevation="8dp"
|
card_view:cardElevation="8dp"
|
||||||
card_view:contentPaddingLeft="6dp"
|
card_view:contentPaddingLeft="6dp"
|
||||||
card_view:contentPaddingRight="6dp">
|
card_view:contentPaddingRight="6dp"
|
||||||
|
tools:ignore="contentDescription">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/card_bg_layout"
|
android:id="@+id/card_bg_layout"
|
||||||
|
|
@ -35,19 +35,19 @@
|
||||||
android:id="@+id/tvVoid"
|
android:id="@+id/tvVoid"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:alpha="0.33"
|
android:alpha="0.33"
|
||||||
android:fontFamily="@font/raleway_el"
|
android:fontFamily="@font/raleway_el"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:rotation="-25"
|
android:rotation="-25"
|
||||||
android:text="VOID"
|
|
||||||
android:textColor="@color/msg_err"
|
android:textColor="@color/msg_err"
|
||||||
android:textSize="96dp"/>
|
android:textSize="96sp"
|
||||||
|
tools:text="VOID"/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="16dp"
|
android:layout_width="16dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="1dp"
|
android:layout_marginStart="1dp"
|
||||||
android:foregroundGravity="center">
|
android:foregroundGravity="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -61,21 +61,21 @@
|
||||||
android:id="@+id/tvType"
|
android:id="@+id/tvType"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="1dp"
|
android:layout_marginStart="1dp"
|
||||||
android:alpha="0.6"
|
android:alpha="0.6"
|
||||||
android:fontFamily="@font/raleway_el"
|
android:fontFamily="@font/raleway_el"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text=" DEVELOPER KIT "
|
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="12dp"/>
|
android:textSize="12sp"
|
||||||
|
tools:text=" DEVELOPER KIT "/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -105,9 +105,9 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="0dp"
|
android:layout_margin="0dp"
|
||||||
android:fontFamily="@font/raleway_r"
|
android:fontFamily="@font/raleway_r"
|
||||||
android:text="Balance "
|
android:text="@string/balance"
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="@dimen/font_large"/>
|
android:textSize="@dimen/text_size_large"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvBalance"
|
android:id="@+id/tvBalance"
|
||||||
|
|
@ -115,10 +115,11 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="0dp"
|
android:layout_margin="0dp"
|
||||||
android:fontFamily="@font/montserrat_light"
|
android:fontFamily="@font/montserrat_light"
|
||||||
android:text="0.0 mBTC"
|
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/font_large"
|
android:textSize="@dimen/text_size_large"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold"
|
||||||
|
tools:text="0.0 mBTC"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -131,26 +132,27 @@
|
||||||
android:id="@+id/tvOffline"
|
android:id="@+id/tvOffline"
|
||||||
android:layout_width="90dp"
|
android:layout_width="90dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:background="@color/msg_okay"
|
android:background="@color/msg_okay"
|
||||||
android:fontFamily="@font/montserrat_light"
|
android:fontFamily="@font/montserrat_light"
|
||||||
android:text="verified offline"
|
android:text="@string/verified_offline"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/font_small"
|
android:textSize="@dimen/text_size_small"
|
||||||
android:visibility="visible"/>
|
android:visibility="visible"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvBalanceEquivalent"
|
android:id="@+id/tvBalanceEquivalent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="48dp"
|
android:layout_marginEnd="48dp"
|
||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
android:fontFamily="@font/montserrat_light"
|
android:fontFamily="@font/montserrat_light"
|
||||||
android:text="~ USD 0"
|
|
||||||
android:textColor="@color/black_overlay"
|
android:textColor="@color/black_overlay"
|
||||||
android:textSize="14dp"
|
android:textSize="@dimen/text_size_1_small"
|
||||||
android:textStyle="normal|bold"/>
|
android:textStyle="normal|bold"
|
||||||
|
tools:text="~ USD 0"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -163,22 +165,22 @@
|
||||||
android:layout_width="110dp"
|
android:layout_width="110dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/raleway_r"
|
android:fontFamily="@font/raleway_r"
|
||||||
android:text="Blockchain"
|
android:text="@string/blockchain"
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="14dp"/>
|
android:textSize="@dimen/text_size_1_small"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvBlockchain"
|
android:id="@+id/tvBlockchain"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:fontFamily="@font/montserrat_light"
|
android:fontFamily="@font/montserrat_light"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text="Blockchain"
|
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="12dp"
|
android:textSize="@dimen/text_size_small"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold"
|
||||||
|
tools:text="Bitcoin"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -191,9 +193,9 @@
|
||||||
android:layout_width="110dp"
|
android:layout_width="110dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/raleway_r"
|
android:fontFamily="@font/raleway_r"
|
||||||
android:text="Wallet "
|
android:text="@string/wallet"
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="14dp"/>
|
android:textSize="@dimen/text_size_1_small"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvWallet"
|
android:id="@+id/tvWallet"
|
||||||
|
|
@ -202,10 +204,11 @@
|
||||||
android:fontFamily="@font/montserrat_light"
|
android:fontFamily="@font/montserrat_light"
|
||||||
android:lines="1"
|
android:lines="1"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:text=" "
|
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="12dp"
|
android:textSize="@dimen/text_size_small"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold"
|
||||||
|
tools:text="1DoQdnSYshhZ5Tqt5Sk6svZt29jqoYVwQY"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -218,19 +221,19 @@
|
||||||
android:layout_width="110dp"
|
android:layout_width="110dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/raleway_r"
|
android:fontFamily="@font/raleway_r"
|
||||||
android:text="Last unspent "
|
android:text="@string/last_unspent"
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="14dp"/>
|
android:textSize="@dimen/text_size_1_small"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLastInput"
|
android:id="@+id/tvLastInput"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/montserrat_light"
|
android:fontFamily="@font/montserrat_light"
|
||||||
android:text=" "
|
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="12dp"
|
android:textSize="@dimen/text_size_small"
|
||||||
android:textStyle="normal|bold"/>
|
android:textStyle="normal|bold"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
@ -243,19 +246,19 @@
|
||||||
android:layout_width="110dp"
|
android:layout_width="110dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/raleway_r"
|
android:fontFamily="@font/raleway_r"
|
||||||
android:text="Last withdrawal"
|
android:text="@string/last_withdrawal"
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="14dp"/>
|
android:textSize="@dimen/text_size_1_small"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLastOutput"
|
android:id="@+id/tvLastOutput"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@font/montserrat_light"
|
android:fontFamily="@font/montserrat_light"
|
||||||
android:text=" "
|
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="12dp"
|
android:textSize="@dimen/text_size_small"
|
||||||
android:textStyle="normal|bold"/>
|
android:textStyle="normal|bold"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -272,9 +275,9 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:fontFamily="@font/raleway_r"
|
android:fontFamily="@font/raleway_r"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="NO WALLET"
|
android:text="@string/no_wallet"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="@dimen/font_large"/>
|
android:textSize="@dimen/text_size_large"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -290,9 +293,9 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:fontFamily="@font/raleway_r"
|
android:fontFamily="@font/raleway_r"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="ERASED WALLET"
|
android:text="@string/erased_wallet"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="@dimen/font_large"/>
|
android:textSize="@dimen/text_size_large"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -309,11 +312,12 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:fontFamily="@font/raleway_r"
|
android:fontFamily="@font/raleway_r"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="INVALID CARD"
|
android:text="@string/invalid_card"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="@dimen/font_large"/>
|
android:textSize="@dimen/text_size_large"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -328,10 +332,10 @@
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
android:fontFamily="@font/montserrat_light"
|
android:fontFamily="@font/montserrat_light"
|
||||||
android:paddingTop="6dp"
|
android:paddingTop="6dp"
|
||||||
android:text=" "
|
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textColor="@color/primary_dark"
|
android:textColor="@color/primary_dark"
|
||||||
android:textSize="14dp"/>
|
android:textSize="@dimen/text_size_1_small"
|
||||||
|
tools:text="BB00 0000 0001 0022"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
@ -351,9 +355,9 @@
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentStart="false"
|
android:layout_alignParentStart="false"
|
||||||
android:layout_marginBottom="6dp"
|
android:layout_marginBottom="6dp"
|
||||||
android:layout_marginLeft="24dp"
|
android:layout_marginStart="24dp"
|
||||||
android:background="@drawable/ic_info"
|
android:background="@drawable/ic_info"
|
||||||
android:visibility="invisible"/>
|
android:visibility="invisible"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
</android.support.v7.widget.CardView>
|
</android.support.v7.widget.CardView>
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<string name="ok">OK</string>
|
<string name="ok">OK</string>
|
||||||
|
<string name="not_found">Not found</string>
|
||||||
<string name="wrong_tag_err">Not ISO tag!</string>
|
<string name="wrong_tag_err">Not ISO tag!</string>
|
||||||
<string name="msgCardMustBeLoaded">Card must be loaded first!</string>
|
<string name="msgCardMustBeLoaded">Card must be loaded first!</string>
|
||||||
<string name="tag_lost_err">Tag lost!</string>
|
<string name="tag_lost_err">Tag lost!</string>
|
||||||
|
|
@ -51,6 +52,22 @@
|
||||||
<string name="reset_pins_to_default">Reset PINs to default</string>
|
<string name="reset_pins_to_default">Reset PINs to default</string>
|
||||||
<string name="erase_wallet">Erase wallet</string>
|
<string name="erase_wallet">Erase wallet</string>
|
||||||
|
|
||||||
|
<!-- MainActivity, MainFragment -->
|
||||||
|
<string name="tap_tangem_card">Tap Tangem card with your smartphone</string>
|
||||||
|
<string name="scan_banknote">Scan a banknote with your \n smartphone as shown above</string>
|
||||||
|
<string name="try_to_scan_again">Try to scan again</string>
|
||||||
|
<string name="balance">Balance</string>
|
||||||
|
<string name="wallet">Wallet</string>
|
||||||
|
<string name="last_unspent">Last unspent</string>
|
||||||
|
<string name="last_withdrawal">Last withdrawal</string>
|
||||||
|
<string name="blockchain">Blockchain</string>
|
||||||
|
<string name="no_wallet">NO WALLET</string>
|
||||||
|
<string name="erased_wallet">ERASED WALLET</string>
|
||||||
|
<string name="invalid_card">INVALID CARD</string>
|
||||||
|
<string name="verified_offline">verified offline</string>
|
||||||
|
<string name="developer_kit"> DEVELOPER KIT </string>
|
||||||
|
<string name="banknote_banknote"> BANKNOTE BANKNOTE</string>
|
||||||
|
<string name="reusable_reusable"> REUSABLE REUSABLE </string>
|
||||||
|
|
||||||
<!-- LogoActivity -->
|
<!-- LogoActivity -->
|
||||||
<string name="beta">BETA</string>
|
<string name="beta">BETA</string>
|
||||||
|
|
@ -63,11 +80,6 @@
|
||||||
<string name="to_sign_the_payment">to sign the payment</string>
|
<string name="to_sign_the_payment">to sign the payment</string>
|
||||||
<string name="to_change_pin_codes">to change PIN/PIN2 codes</string>
|
<string name="to_change_pin_codes">to change PIN/PIN2 codes</string>
|
||||||
|
|
||||||
<!-- MainActivity -->
|
|
||||||
<string name="tap_tangem_card">Tap Tangem card with your smartphone</string>
|
|
||||||
<string name="scan_banknote">Scan a banknote with your \n smartphone as shown above</string>
|
|
||||||
<string name="try_to_scan_again">Try to scan again</string>
|
|
||||||
|
|
||||||
<!-- PreparePaymentActivity -->
|
<!-- PreparePaymentActivity -->
|
||||||
<string name="send_payment">Send payment</string>
|
<string name="send_payment">Send payment</string>
|
||||||
<string name="from_banknote">From banknote</string>
|
<string name="from_banknote">From banknote</string>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<string name="okay_msg_prefix">** </string>
|
<string name="okay_msg_prefix">** </string>
|
||||||
<string name="err_msg_prefix">!! </string>
|
<string name="err_msg_prefix">!! </string>
|
||||||
<string name="action_msg_prefix">-- </string>
|
<string name="action_msg_prefix">-- </string>
|
||||||
<string name="NoDataString">-- -- --</string>
|
<string name="no_data_string">-- -- --</string>
|
||||||
<string name="pin_back"><</string>
|
<string name="pin_back"><</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue