Updated on 2026-08-14

This commit is contained in:
Tangem 2018-10-10 21:39:43 +03:00
parent 68917838a4
commit d1dc50123f
6 changed files with 62 additions and 69 deletions

View file

@ -122,16 +122,6 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
} else {
rgFee!!.isEnabled = true
// val data = SharedData(SharedData.COUNT_REQUEST)
// val engineCoin = CoinEngineFactory.create(card!!.blockchain)
// for (i in 0 until data.allRequest) {
// val nodeAddress = engineCoin!!.getNode(card)
// val nodePort = engineCoin.getNodePort(card)
// val connectTaskEx = ConnectTask(this@ConfirmPaymentActivity, nodeAddress, nodePort, data)
// connectTaskEx.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, ElectrumRequest.checkBalance(card!!.wallet))
// }
requestElectrum(card!!, ElectrumRequest.checkBalance(card!!.wallet))
calcSize = 256
@ -149,14 +139,6 @@ class ConfirmPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
serverApiHelper!!.estimateFee(ServerApiHelper.ESTIMATE_FEE_PRIORITY)
serverApiHelper!!.estimateFee(ServerApiHelper.ESTIMATE_FEE_NORMAL)
serverApiHelper!!.estimateFee(ServerApiHelper.ESTIMATE_FEE_MINIMAL)
// for (i in 0 until SharedData.COUNT_REQUEST) {
// val feeTask = ConnectFeeTask(this@ConfirmPaymentActivity, sharedFee)
// feeTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
// FeeRequest.GetFee(card!!.wallet, calcSize.toLong(), FeeRequest.NORMAL),
// FeeRequest.GetFee(card!!.wallet, calcSize.toLong(), FeeRequest.MINIMAL),
// FeeRequest.GetFee(card!!.wallet, calcSize.toLong(), FeeRequest.PRIORITY))
// }
}
// set listeners

View file

@ -88,20 +88,19 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
}
}
etAmount.setOnEditorActionListener{lv,actionId,event->
etAmount.setOnEditorActionListener { lv, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
val imm = lv.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(lv.windowToken, 0)
lv.clearFocus()
true
}else {
} else {
false
}
}
// set listeners
btnLoad.setOnClickListener {
try {
val strAmount: String = etAmount.text.toString().replace(",", ".")
@ -159,7 +158,7 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
tvError.visibility = View.VISIBLE
tvError.text = Arrays.toString(response.error)
} else {
Toast.makeText(this,"Withdrawal successful!", Toast.LENGTH_LONG).show()
Toast.makeText(this, "Withdrawal successful!", Toast.LENGTH_LONG).show()
finish()
}
}
@ -173,6 +172,7 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
showConfirmDialog()
}
}
btnLoad.visibility = View.INVISIBLE
doRequestBalance()
}
@ -190,7 +190,7 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
builder.setTitle("Please confirm withdraw")
// Set a message for alert dialog
builder.setMessage(String.format("Continue with fee %s %s?", fee!!.toString().trimEnd('0'),card!!.blockchain.currency))
builder.setMessage(String.format("Continue with fee %s %s?", fee!!.toString().trimEnd('0'), card!!.blockchain.currency))
// On click listener for dialog buttons
val dialogClickListener = DialogInterface.OnClickListener { _, which ->
@ -201,7 +201,7 @@ class PrepareKrakenWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCa
var dblAmount: Double = strAmount.toDouble()
dblAmount+=fee!!.toDouble()
dblAmount += fee!!.toDouble()
rlProgressBar.visibility = View.VISIBLE
tvProgressDescription.text = getString(R.string.kraken_request_withdrawal)