Updated on 2026-08-14
This commit is contained in:
parent
90636a0e6a
commit
cfaaa3205f
13 changed files with 98 additions and 47 deletions
|
|
@ -75,7 +75,6 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
etAmount = findViewById(R.id.etAmount)
|
||||
etFee = findViewById(R.id.etFee)
|
||||
tvFeeEquivalent = findViewById(R.id.tvFeeEquivalent)
|
||||
rgFee = findViewById(R.id.rgFee)
|
||||
|
||||
val engine = CoinEngineFactory.create(card!!.blockchain)
|
||||
if (card!!.blockchain == Blockchain.Token) {
|
||||
|
|
@ -84,6 +83,12 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
} else
|
||||
tvBalance.text = engine!!.getBalanceWithAlter(card)
|
||||
|
||||
if(intent.getBooleanExtra("IncFee", true)) {
|
||||
tvIncFee!!.setText(R.string.feein);
|
||||
} else {
|
||||
tvIncFee!!.setText(R.string.feeout);
|
||||
}
|
||||
|
||||
etAmount!!.setText(intent.getStringExtra(SignPaymentActivity.EXTRA_AMOUNT))
|
||||
tvCurrency.text = engine.getBalanceCurrency(card)
|
||||
tvCurrency2.text = engine.feeCurrency
|
||||
|
|
@ -176,7 +181,7 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
val req = InfuraRequest.GetGasPrise(card!!.wallet)
|
||||
req.id = 67
|
||||
req.setBlockchain(card!!.blockchain)
|
||||
rgFee!!.isEnabled = false
|
||||
rgFee!!.isEnabled = true
|
||||
task.execute(req)
|
||||
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import android.support.v7.app.AppCompatActivity
|
|||
import android.text.Html
|
||||
import android.text.InputFilter
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import com.tangem.domain.cardReader.NfcManager
|
||||
import com.tangem.domain.wallet.Blockchain
|
||||
|
|
@ -52,8 +53,11 @@ class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
if (card!!.blockchain == Blockchain.Token) {
|
||||
val html = Html.fromHtml(engine!!.getBalanceWithAlter(card))
|
||||
tvBalance.text = html
|
||||
} else
|
||||
rgIncFee!!.visibility = View.INVISIBLE
|
||||
} else {
|
||||
tvBalance.text = engine!!.getBalanceWithAlter(card)
|
||||
rgIncFee!!.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
if (card!!.remainingSignatures < 2)
|
||||
etAmount.isEnabled = false
|
||||
|
|
@ -80,11 +84,7 @@ class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
tvCurrency.text = "m" + card!!.blockchain.currency
|
||||
useCurrency = true
|
||||
val output = FormatUtil.DoubleToString(balance)
|
||||
etAmount.setText(output)
|
||||
}
|
||||
|
||||
// Default
|
||||
else {
|
||||
} else {
|
||||
tvCurrency.text = engine.getBalanceCurrency(card)
|
||||
useCurrency = false
|
||||
etAmount.setText(engine.getBalanceValue(card))
|
||||
|
|
@ -137,6 +137,7 @@ class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
intent.putExtra("UID", card!!.uid)
|
||||
intent.putExtra("Card", card!!.asBundle)
|
||||
intent.putExtra("Wallet", etWallet!!.text.toString())
|
||||
intent.putExtra("IncFee", (rgIncFee!!.checkedRadioButtonId == R.id.rbFeeIn))
|
||||
intent.putExtra(SignPaymentActivity.EXTRA_AMOUNT, strAmount)
|
||||
startActivityForResult(intent, REQUEST_CODE_SEND_PAYMENT)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class SignPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
|
||||
private var amountStr: String? = null
|
||||
private var feeStr: String? = null
|
||||
private var incfeeBool = true
|
||||
private var outAddressStr: String? = null
|
||||
private var lastReadSuccess = true
|
||||
|
||||
|
|
@ -58,6 +59,7 @@ class SignPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
|
||||
amountStr = intent.getStringExtra(EXTRA_AMOUNT)
|
||||
feeStr = intent.getStringExtra("Fee")
|
||||
incfeeBool = intent.getBooleanExtra("IncFee", true)
|
||||
outAddressStr = intent.getStringExtra("Wallet")
|
||||
|
||||
tvCardID.text = card!!.cidDescription
|
||||
|
|
@ -82,7 +84,7 @@ class SignPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
} else {
|
||||
isoDep.timeout = card!!.pauseBeforePIN2 + 65000
|
||||
}
|
||||
signPaymentTask = SignPaymentTask(this, card, nfcManager, isoDep, this, amountStr, feeStr, outAddressStr)
|
||||
signPaymentTask = SignPaymentTask(this, card, nfcManager, isoDep, this, amountStr, feeStr,incfeeBool, outAddressStr)
|
||||
signPaymentTask!!.start()
|
||||
} else {
|
||||
// Log.d(TAG, "Mismatch card UID (" + sUID + " instead of " + card!!.uid + ")")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue