Updated on 2026-08-14
This commit is contained in:
parent
e97c936c92
commit
573101570b
15 changed files with 65 additions and 92 deletions
|
|
@ -264,7 +264,7 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
minFee = minFeeInGwei
|
||||
normalFee = normalFeeInGwei
|
||||
maxFee = maxFeeInGwei
|
||||
etFee!!.setText(normalFeeInGwei)
|
||||
etFee!!.setText(normalFeeInGwei.replace(',','.'))
|
||||
etFee!!.error = null
|
||||
btnSend!!.visibility = View.VISIBLE
|
||||
feeRequestSuccess = true
|
||||
|
|
@ -449,23 +449,25 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
}
|
||||
|
||||
fun doSetFee(checkedRadioButtonId: Int) {
|
||||
var txtFee = ""
|
||||
when (checkedRadioButtonId) {
|
||||
R.id.rbMinimalFee ->
|
||||
if (minFee != null)
|
||||
etFee!!.setText(minFee)
|
||||
txtFee = minFee.toString()
|
||||
else
|
||||
etFee!!.setText("?")
|
||||
finishActivityWithError(Activity.RESULT_CANCELED, getString(R.string.cannot_obtain_data_from_blockchain))
|
||||
R.id.rbNormalFee ->
|
||||
if (normalFee != null)
|
||||
etFee!!.setText(normalFee)
|
||||
txtFee = normalFee.toString()
|
||||
else
|
||||
etFee!!.setText("?")
|
||||
finishActivityWithError(Activity.RESULT_CANCELED, getString(R.string.cannot_obtain_data_from_blockchain))
|
||||
R.id.rbMaximumFee ->
|
||||
if (maxFee != null)
|
||||
etFee!!.setText(maxFee)
|
||||
txtFee = maxFee.toString()
|
||||
else
|
||||
etFee!!.setText("?")
|
||||
finishActivityWithError(Activity.RESULT_CANCELED, getString(R.string.cannot_obtain_data_from_blockchain))
|
||||
}
|
||||
etFee!!.setText(txtFee.replace(',','.'))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,7 +30,6 @@ class PrepareCryptonitOtherAPIWithdrawalActivity : AppCompatActivity(), NfcAdapt
|
|||
private const val REQUEST_CODE_SCAN_QR_USER_ID = 3
|
||||
}
|
||||
|
||||
private var useCurrencyX1000: Boolean = false
|
||||
private var card: TangemCard? = null
|
||||
private var nfcManager: NfcManager? = null
|
||||
private var cryptonit: Cryptonit_OtherAPI? = null
|
||||
|
|
@ -61,16 +60,12 @@ class PrepareCryptonitOtherAPIWithdrawalActivity : AppCompatActivity(), NfcAdapt
|
|||
when (card!!.blockchain) {
|
||||
Blockchain.Ethereum, Blockchain.EthereumTestNet -> {
|
||||
tvCurrency.text = engine.getBalanceCurrency(card)
|
||||
useCurrencyX1000 = false
|
||||
|
||||
}
|
||||
Blockchain.Bitcoin, Blockchain.BitcoinTestNet, Blockchain.BitcoinCash, Blockchain.BitcoinCashTestNet -> {
|
||||
tvCurrency.text = "m" + card!!.blockchain.currency
|
||||
useCurrencyX1000 = true
|
||||
tvCurrency.text = card!!.blockchain.currency
|
||||
}
|
||||
else -> {
|
||||
tvCurrency.text = engine.getBalanceCurrency(card)
|
||||
useCurrencyX1000 = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +89,6 @@ class PrepareCryptonitOtherAPIWithdrawalActivity : AppCompatActivity(), NfcAdapt
|
|||
// if (!engine.checkAmount(card, strAmount))
|
||||
// etAmount.error = getString(R.string.unknown_amount_format)
|
||||
var dblAmount: Double = strAmount.toDouble()
|
||||
if (useCurrencyX1000) dblAmount /= 1000.0
|
||||
|
||||
rlProgressBar.visibility = View.VISIBLE
|
||||
tvProgressDescription.text = getString(R.string.cryptonit_request_withdrawal)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ class PrepareCryptonitWithdrawalActivity : AppCompatActivity(), NfcAdapter.Reade
|
|||
val TAG: String = PrepareCryptonitWithdrawalActivity::class.java.simpleName
|
||||
}
|
||||
|
||||
private var useCurrencyX1000: Boolean = false
|
||||
private var card: TangemCard? = null
|
||||
private var nfcManager: NfcManager? = null
|
||||
private var cryptonit: Cryptonit? = null
|
||||
|
|
@ -60,16 +59,12 @@ class PrepareCryptonitWithdrawalActivity : AppCompatActivity(), NfcAdapter.Reade
|
|||
when (card!!.blockchain) {
|
||||
Blockchain.Ethereum -> {
|
||||
tvCurrency.text = engine.getBalanceCurrency(card)
|
||||
useCurrencyX1000 = false
|
||||
|
||||
}
|
||||
Blockchain.Bitcoin, Blockchain.BitcoinCash -> {
|
||||
tvCurrency.text = "m" + card!!.blockchain.currency
|
||||
useCurrencyX1000 = true
|
||||
tvCurrency.text = card!!.blockchain.currency
|
||||
}
|
||||
else -> {
|
||||
tvCurrency.text = engine.getBalanceCurrency(card)
|
||||
useCurrencyX1000 = false
|
||||
}
|
||||
}
|
||||
tvFeeCurrency.text = tvCurrency.text
|
||||
|
|
@ -109,10 +104,6 @@ class PrepareCryptonitWithdrawalActivity : AppCompatActivity(), NfcAdapter.Reade
|
|||
val strFee: String = etFee.text.toString().replace(",", ".")
|
||||
var dblAmount: Double = strAmount.toDouble()
|
||||
var dblFee: Double = strFee.toDouble()
|
||||
if (useCurrencyX1000){
|
||||
dblAmount /= 1000.0
|
||||
dblFee /= 1000.0
|
||||
}
|
||||
cryptonit!!.fee=strFee
|
||||
|
||||
rlProgressBar.visibility = View.VISIBLE
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
|
|||
private const val REQUEST_CODE_SCAN_QR = 1
|
||||
}
|
||||
|
||||
private var useCurrencyX1000: Boolean = false
|
||||
private var card: TangemCard? = null
|
||||
private var nfcManager: NfcManager? = null
|
||||
private var kraken: Kraken? = null
|
||||
|
|
@ -67,16 +66,13 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
|
|||
when (card!!.blockchain) {
|
||||
Blockchain.Ethereum, Blockchain.EthereumTestNet -> {
|
||||
tvCurrency.text = engine.getBalanceCurrency(card)
|
||||
useCurrencyX1000 = false
|
||||
|
||||
}
|
||||
Blockchain.Bitcoin, Blockchain.BitcoinTestNet, Blockchain.BitcoinCash, Blockchain.BitcoinCashTestNet -> {
|
||||
tvCurrency.text = "m" + card!!.blockchain.currency
|
||||
useCurrencyX1000 = true
|
||||
tvCurrency.text = card!!.blockchain.currency
|
||||
}
|
||||
else -> {
|
||||
tvCurrency.text = engine.getBalanceCurrency(card)
|
||||
useCurrencyX1000 = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -110,8 +106,6 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
|
|||
val strAmount: String = etAmount.text.toString().replace(",", ".")
|
||||
|
||||
var dblAmount: Double = strAmount.toDouble()
|
||||
if (useCurrencyX1000) dblAmount /= 1000.0
|
||||
|
||||
rlProgressBar.visibility = View.VISIBLE
|
||||
tvProgressDescription.text = getString(R.string.kraken_request_withdrawal)
|
||||
|
||||
|
|
@ -206,7 +200,6 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
|
|||
val strAmount: String = etAmount.text.toString().replace(",", ".")
|
||||
|
||||
var dblAmount: Double = strAmount.toDouble()
|
||||
if (useCurrencyX1000) dblAmount /= 1000.0
|
||||
|
||||
dblAmount+=fee!!.toDouble()
|
||||
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
|
||||
// Bitcoin BitcoinTestNet
|
||||
else if (card!!.blockchain == Blockchain.Bitcoin || card!!.blockchain == Blockchain.BitcoinTestNet) {
|
||||
val balance = engine.getBalanceLong(card)!! / (card!!.blockchain.multiplier / 1000.0)
|
||||
tvCurrency.text = "m" + card!!.blockchain.currency
|
||||
val balance = engine.getBalanceLong(card)!! / (card!!.blockchain.multiplier)
|
||||
tvCurrency.text = card!!.blockchain.currency
|
||||
useCurrency = true
|
||||
val output = FormatUtil.DoubleToString(balance)
|
||||
etAmount.setText(output)
|
||||
|
|
@ -81,8 +81,8 @@ class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
|
||||
// BitcoinCash BitcoinCashTestNet
|
||||
else if (card!!.blockchain == Blockchain.BitcoinCash || card!!.blockchain == Blockchain.BitcoinCashTestNet) {
|
||||
val balance = engine.getBalanceLong(card)!! / (card!!.blockchain.multiplier / 1000.0)
|
||||
tvCurrency.text = "m" + card!!.blockchain.currency
|
||||
val balance = engine.getBalanceLong(card)!! / (card!!.blockchain.multiplier)
|
||||
tvCurrency.text = card!!.blockchain.currency
|
||||
useCurrency = true
|
||||
val output = FormatUtil.DoubleToString(balance)
|
||||
} else {
|
||||
|
|
@ -92,7 +92,7 @@ class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
}
|
||||
|
||||
if (card!!.blockchain == Blockchain.Bitcoin)
|
||||
etAmount.filters = arrayOf<InputFilter>(DecimalDigitsInputFilter(5))
|
||||
etAmount.filters = arrayOf<InputFilter>(DecimalDigitsInputFilter(8))
|
||||
|
||||
if (card!!.blockchain == Blockchain.BitcoinCash)
|
||||
etAmount.filters = arrayOf<InputFilter>(DecimalDigitsInputFilter(8))
|
||||
|
|
|
|||
|
|
@ -726,15 +726,24 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
|
||||
tvBlockchain.text = card!!.blockchainName
|
||||
|
||||
if (card!!.hasBalanceInfo() && (card!!.balance != 0L) ) {
|
||||
btnExtract.isEnabled = true
|
||||
btnExtract.backgroundTintList = activeColor
|
||||
} else {
|
||||
if (card!!.blockchain != Blockchain.Token) {
|
||||
if (card!!.hasBalanceInfo() && (card!!.balance != 0L) ) {
|
||||
btnExtract.isEnabled = true
|
||||
btnExtract.backgroundTintList = activeColor
|
||||
} else {
|
||||
btnExtract.isEnabled = false
|
||||
btnExtract.backgroundTintList = inactiveColor
|
||||
}
|
||||
}
|
||||
else if (card!!.decimalBalanceAlter == "") {
|
||||
btnExtract.isEnabled = false
|
||||
btnExtract.backgroundTintList = inactiveColor
|
||||
} else {
|
||||
btnExtract.isEnabled = true
|
||||
btnExtract.backgroundTintList = activeColor
|
||||
}
|
||||
|
||||
card!!.error = null
|
||||
card!!.error = null
|
||||
card!!.message = null
|
||||
|
||||
} catch (e: Exception) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue