diff --git a/app/src/main/java/com/tangem/wallet/bch/BtcCashEngine.java b/app/src/main/java/com/tangem/wallet/bch/BtcCashEngine.java index 03a2d3c2ce..2acdefb4bc 100644 --- a/app/src/main/java/com/tangem/wallet/bch/BtcCashEngine.java +++ b/app/src/main/java/com/tangem/wallet/bch/BtcCashEngine.java @@ -24,6 +24,7 @@ import com.tangem.wallet.TangemContext; import com.tangem.wallet.Transaction; import com.tangem.wallet.UnspentOutputInfo; import com.tangem.wallet.btc.BtcData; +import com.tangem.wallet.btc.Unspents; import org.json.JSONArray; import org.json.JSONException; @@ -424,7 +425,15 @@ public class BtcCashEngine extends CoinEngine { @Override public String getUnspentInputsDescription() { - return coinData.getUnspentInputsDescription(); + Unspents unspents = coinData.getUnspentInputsDescription(); + if (unspents == null) { + return ""; + } else { + return String.format( + ctx.getContext().getString(R.string.details_unspents_number), + unspents.getUnspetns(), + unspents.getGatheredUnspents()); + } } @Override diff --git a/app/src/main/java/com/tangem/wallet/btc/BtcData.java b/app/src/main/java/com/tangem/wallet/btc/BtcData.java index 71c1d7c8f1..0d0eca1d85 100644 --- a/app/src/main/java/com/tangem/wallet/btc/BtcData.java +++ b/app/src/main/java/com/tangem/wallet/btc/BtcData.java @@ -22,18 +22,19 @@ public class BtcData extends CoinData { //for blockchain.info private boolean hasUnconfirmed = false; - public String getUnspentInputsDescription() { + public Unspents getUnspentInputsDescription() { try { int gatheredUnspents = 0; - if (unspentTransactions == null) return ""; + if (unspentTransactions == null) return null; for (int i = 0; i < unspentTransactions.size(); i++) { if (unspentTransactions.get(i).script != null && unspentTransactions.get(i).script.length() > 1) gatheredUnspents++; } - return unspentTransactions.size() + " unspents (" + gatheredUnspents + " received)"; + + return new Unspents(unspentTransactions.size(), gatheredUnspents); } catch (Exception e) { e.printStackTrace(); - return ""; + return null; } } diff --git a/app/src/main/java/com/tangem/wallet/btc/BtcEngine.java b/app/src/main/java/com/tangem/wallet/btc/BtcEngine.java index 021ce73e38..fd49ed7ec4 100644 --- a/app/src/main/java/com/tangem/wallet/btc/BtcEngine.java +++ b/app/src/main/java/com/tangem/wallet/btc/BtcEngine.java @@ -437,7 +437,15 @@ public class BtcEngine extends CoinEngine { @Override public String getUnspentInputsDescription() { - return coinData.getUnspentInputsDescription(); + Unspents unspents = coinData.getUnspentInputsDescription(); + if (unspents == null) { + return ""; + } else { + return String.format( + ctx.getContext().getString(R.string.details_unspents_number), + unspents.getUnspetns(), + unspents.getGatheredUnspents()); + } } @Override diff --git a/app/src/main/java/com/tangem/wallet/btc/Unspents.kt b/app/src/main/java/com/tangem/wallet/btc/Unspents.kt new file mode 100644 index 0000000000..12029683e3 --- /dev/null +++ b/app/src/main/java/com/tangem/wallet/btc/Unspents.kt @@ -0,0 +1,3 @@ +package com.tangem.wallet.btc + +data class Unspents(val unspetns: Int, val gatheredUnspents: Int) \ No newline at end of file diff --git a/app/src/main/java/com/tangem/wallet/ducatus/DucatusEngine.java b/app/src/main/java/com/tangem/wallet/ducatus/DucatusEngine.java index c8c3ed8122..17e8b9789c 100644 --- a/app/src/main/java/com/tangem/wallet/ducatus/DucatusEngine.java +++ b/app/src/main/java/com/tangem/wallet/ducatus/DucatusEngine.java @@ -25,6 +25,7 @@ import com.tangem.wallet.Transaction; import com.tangem.wallet.UnspentOutputInfo; import com.tangem.wallet.btc.BtcData; import com.tangem.wallet.btc.BtcEngine; +import com.tangem.wallet.btc.Unspents; import java.io.ByteArrayOutputStream; import java.math.BigDecimal; @@ -377,7 +378,15 @@ public class DucatusEngine extends BtcEngine { @Override public String getUnspentInputsDescription() { - return coinData.getUnspentInputsDescription(); + Unspents unspents = coinData.getUnspentInputsDescription(); + if (unspents == null) { + return ""; + } else { + return String.format( + ctx.getContext().getString(R.string.details_unspents_number), + unspents.getUnspetns(), + unspents.getGatheredUnspents()); + } } @Override diff --git a/app/src/main/java/com/tangem/wallet/ltc/LtcEngine.java b/app/src/main/java/com/tangem/wallet/ltc/LtcEngine.java index a2a6abc339..7402e658d9 100644 --- a/app/src/main/java/com/tangem/wallet/ltc/LtcEngine.java +++ b/app/src/main/java/com/tangem/wallet/ltc/LtcEngine.java @@ -31,6 +31,7 @@ import com.tangem.wallet.Transaction; import com.tangem.wallet.UnspentOutputInfo; import com.tangem.wallet.btc.BtcData; import com.tangem.wallet.btc.BtcEngine; +import com.tangem.wallet.btc.Unspents; import org.json.JSONException; @@ -389,7 +390,15 @@ public class LtcEngine extends BtcEngine { @Override public String getUnspentInputsDescription() { - return coinData.getUnspentInputsDescription(); + Unspents unspents = coinData.getUnspentInputsDescription(); + if (unspents == null) { + return ""; + } else { + return String.format( + ctx.getContext().getString(R.string.details_unspents_number), + unspents.getUnspetns(), + unspents.getGatheredUnspents()); + } } @Override diff --git a/app/src/main/res/layout/fr_verify_card.xml b/app/src/main/res/layout/fr_verify_card.xml index 09cbf321ca..189186e5f5 100644 --- a/app/src/main/res/layout/fr_verify_card.xml +++ b/app/src/main/res/layout/fr_verify_card.xml @@ -198,7 +198,7 @@ android:layout_height="wrap_content" android:layout_marginStart="20dp" android:fontFamily="@font/maax" - android:text="The card is linked" + android:text="@string/details_linked_card_title" android:textSize="@dimen/text_size_1_small" /> Continuer Le code PIN est vide Blockchain - Réessayez de numériser + Réessayez de scanner la carte Impossible d\'effacer le porte-monnaie avec un solde différent de zéro - Envoyer le paiement + Transférer les fonds Depuis la carte sur la carte avec solde @@ -49,9 +49,9 @@ Oups .. Il semble que votre smartphone ne supporte pas de tels paquets NFC. Essayez d\'envoyer une quantité inférieure ou utilisez un smartphone avec prise en charge complète de NFC. Votre argent est en jeu! - Cette carte a imposé un délai de sécurité - Veuillez tenir la carte fermement \ n jusqu\'à ce que l\'opération soit terminée… - Vous devrez peut-être répéter cette opération plusieurs fois en fonction des performances NFC de votre smartphone. \ n Ceci est fait pour sécuriser vos fonds. + Cette carte impose un délai de sécurité pour confirmer le transfert des fonds + Veuillez maintenir la carte dans cette position jusqu\'à ce que l\'opération soit terminée… + Vous devrez peut-être répéter cette opération plusieurs fois en fonction des performances NFC de votre smartphone.\nCeci est fait pour sécuriser vos fonds. Gérer le code PIN de l\'utilisateur… @@ -74,12 +74,14 @@ Mettez en contact la carte avec votre smartphone - Scanner une carte avec votre \n %1$s \n comme indiqué ci-dessus + Scanner votre carte avec votre %1$s comme indiqué ci-dessus phone Le porte-monnaie a été effacé Non personnalisé Il existe une nouvelle version de l\'application: %1$s Mettre à jour + Vous n’avez pas de carte?\nVisitez notre boutique sur %1$s + Aucun porte-monnaie compatible installé @@ -146,10 +148,10 @@ L\'authenticité ne peut pas être vérifiée. Balayez vers le bas pour actualiser.      - Maintenant, touchez la carte avec l\'ID + Maintenir la carte avec l\’ID pour créer le porte-monnaie pour effacer le porte-monnaie - pour signer le paiement + pour confirmer le transfert des fonds pour changer les codes PIN / PIN2 En mettant la carte en contact avec votre smartphone, vous retirerez définitivement le porte-monnaie de la blockchain. Assurez-vous qu\'il n\'y aura pas d\'autres transactions entrantes Impossible d\'effacer le porte-monnaie. Veillez à entrer le code PIN2 correct! @@ -178,7 +180,7 @@ entrez l\'adresse du porte-monnaie entrer le montant - Vérifiez + Vérifier Pas assez de fonds Format de montant inconnu Adresse du porte-monnaie de destination incorrecte @@ -223,12 +225,12 @@ Fabricant Porte-monnaie Identité de la carte - Attested + Attestée Non confirmé Réutilisable None Le dernier! - Unlimited + illimitées Carte ponctuelle Micrologiciel Date d\'enregistrement @@ -238,7 +240,7 @@ Émetteur Clé privée Noeud de validation - Unspents + Transferts Cette carte est protégée par le code PIN1 par défaut Cette carte est protégée par le code PIN1 de l’utilisateur Cette carte est protégée par le code PIN2 par défaut @@ -255,8 +257,9 @@ Bloquable\n Mode de commande atomique\n La liaison au terminal est prise en charge\n - La carte est liée + La carte est associée à ce téléphone + %1$d envoyé(s), %2$d reçu(s) Enregistrer diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ebf79111a2..e5cfe74312 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -82,7 +82,7 @@ There is a new application version: %1$s Update Don\'t have a card?\n Visit our store at %1$s - tangemcards.com + tangemcards.com No compatible wallets installed @@ -262,6 +262,7 @@ Linking to the terminal is supported\n The card is linked To this phone + %1$d unspents (%2$d received) Save