Improve SendTransactionFragment's QR code read feature to account for cases when the QR code is for a smartcoin (starts with bit).

This commit is contained in:
Severiano Jaramillo 2019-01-16 13:48:35 -06:00
parent 3f52a67d35
commit ea80a3e7e3

View file

@ -358,14 +358,18 @@ class SendTransactionFragment : ConnectedFragment(), ZXingScannerView.ResultHand
tietTo.setText(invoice.to) tietTo.setText(invoice.to)
for (i in 0 until mBalancesDetailsAdapter!!.count) { // Try to select the invoice's Asset in the Assets spinner
if (mBalancesDetailsAdapter!!.getItem(i)!!.symbol == invoice.currency.toUpperCase()) { for (i in 0 until (mBalancesDetailsAdapter?.count ?: 0)) {
if (mBalancesDetailsAdapter?.getItem(i)?.symbol == invoice.currency.toUpperCase() ||
(invoice.currency.startsWith("bit", true) &&
invoice.currency.replaceFirst("bit", "").toUpperCase() ==
mBalancesDetailsAdapter?.getItem(i)?.symbol)) {
spAsset.setSelection(i) spAsset.setSelection(i)
break break
} }
} }
tietMemo.setText(invoice.memo)
tietMemo.setText(invoice.memo)
var amount = 0.0 var amount = 0.0
for (nextItem in invoice.lineItems) { for (nextItem in invoice.lineItems) {