Commit 16c7ac54 authored by pokkst's avatar pokkst

[HEAVY WIP] Refactor and rewrite the entire app so most screens utilize their...

[HEAVY WIP] Refactor and rewrite the entire app so most screens utilize their own activity for better code structure, and performance.
parent 96e97ea6
......@@ -32,7 +32,46 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.SendActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity android:name=".activity.ReceiveActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity android:name=".activity.SettingsActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity android:name=".activity.EncryptWalletActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity android:name=".activity.AdvancedSettingsActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity android:name=".activity.KeysListActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity android:name=".activity.UtxosListActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity android:name=".activity.ManageKeyActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustNothing">
</activity>
<activity
android:name="com.journeyapps.barcodescanner.CaptureActivity"
android:screenOrientation="portrait"
......
package app.crescentcash.src.activity
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.get
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import app.crescentcash.src.MainActivity
import app.crescentcash.src.R
import app.crescentcash.src.manager.AppManager
import app.crescentcash.src.manager.UIManager
import app.crescentcash.src.manager.WalletManager
import app.crescentcash.src.qr.QRHelper
import app.crescentcash.src.ui.NonScrollListView
import app.crescentcash.src.ui.UIHelper
import app.crescentcash.src.utils.Constants
import app.crescentcash.src.wallet.WalletHelper
import com.google.android.material.floatingactionbutton.FloatingActionButton
import org.bitcoinj.core.CashAddressFactory
import org.bitcoinj.core.ECKey
import org.bitcoinj.core.TransactionOutput
import org.bitcoinj.utils.MonetaryFormat
import org.bitcoinj.wallet.Wallet
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.util.*
class AdvancedSettingsActivity : AppCompatActivity() {
lateinit var networkNodeText: EditText
lateinit var btnScanPrivateKey: Button
private lateinit var btnShowAddresses: Button
lateinit var messageToVerify: EditText
lateinit var addressToVerify: EditText
lateinit var verifySignature: EditText
private lateinit var btnVerifySig: Button
lateinit var verifySigScreen: FrameLayout
private lateinit var btnShowVerifySigScreen: Button
private lateinit var btnScanMsgToVerify: ImageView
private lateinit var btnScanAddrToVerify: ImageView
private lateinit var btnScanSigToVerify: ImageView
private lateinit var btnShowUtxos: Button
lateinit var addOpReturnSwitch: Switch
lateinit var allowLegacyP2SHSwitch: Switch
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.setContentView(R.layout.advanced_settings)
this.findViews()
this.prepareViews()
this.initListeners()
}
private fun prepareViews() {
UIManager.determineTheme(this)
this.allowLegacyP2SHSwitch.isChecked = WalletHelper.allowLegacyP2SH
this.addOpReturnSwitch.isChecked = WalletHelper.addOpReturn
}
private fun findViews() {
networkNodeText = this.findViewById(R.id.nodeIP)
btnScanPrivateKey = this.findViewById(R.id.btnScanPrivateKey)
btnShowAddresses = this.findViewById(R.id.btnShowAddresses)
messageToVerify = this.findViewById(R.id.messageToVerify)
addressToVerify = this.findViewById(R.id.addressToVerify)
verifySignature = this.findViewById(R.id.verifySignature)
btnVerifySig = this.findViewById(R.id.btnVerifySig)
verifySigScreen = this.findViewById(R.id.verifyKeyScreen)
btnShowVerifySigScreen = this.findViewById(R.id.btnShowVerifyScreen)
btnScanMsgToVerify = this.findViewById(R.id.btnScanMessageToVerify)
btnScanAddrToVerify = this.findViewById(R.id.btnScanAddressToVerify)
btnScanSigToVerify = this.findViewById(R.id.btnScanSigToVerify)
btnShowUtxos = this.findViewById(R.id.btnShowUtxos)
allowLegacyP2SHSwitch = this.findViewById(R.id.allowLegacyP2SHSwitch)
addOpReturnSwitch = this.findViewById(R.id.addOpReturnSwitch)
}
private fun initListeners() {
this.btnScanPrivateKey.setOnClickListener { UIManager.clickScanQR(this, Constants.REQUEST_CODE_SWEEP_SCAN) }
this.btnShowAddresses.setOnClickListener {
val keysListActivity = Intent(this, KeysListActivity::class.java)
startActivity(keysListActivity)
}
this.btnShowVerifySigScreen.setOnClickListener {
this.verifySigScreen.visibility = View.VISIBLE
}
this.btnVerifySig.setOnClickListener {
val message = messageToVerify.text.toString()
val address = addressToVerify.text.toString()
val signature = verifySignature.text.toString()
if(!TextUtils.isEmpty(message) && !TextUtils.isEmpty(address) && !TextUtils.isEmpty(signature)) {
if(address.contains("#")) {
object: Thread() {
override fun run() {
WalletManager().verify(address, signature, message)
}
}.start()
} else {
WalletManager().verify(address, signature, message)
}
}
}
this.btnScanMsgToVerify.setOnClickListener { UIManager.clickScanQR(this, Constants.REQUEST_CODE_SIG_VERIFY_MESSAGE_SCAN) }
this.btnScanAddrToVerify.setOnClickListener { UIManager.clickScanQR(this, Constants.REQUEST_CODE_SIG_VERIFY_ADDRESS_SCAN) }
this.btnScanSigToVerify.setOnClickListener { UIManager.clickScanQR(this, Constants.REQUEST_CODE_SIG_VERIFY_SIGNATURE_SCAN) }
val onTextChangeListener = object: TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
override fun afterTextChanged(s: Editable?) {
println(networkNodeText.text.toString())
MainActivity.INSTANCE.prefs.edit().putString("networkNode", networkNodeText.text.toString()).apply()
}
}
this.networkNodeText.addTextChangedListener(onTextChangeListener)
this.btnShowUtxos.setOnClickListener {
UIManager.startActivity(this, UtxosListActivity::class.java)
}
this.allowLegacyP2SHSwitch.setOnCheckedChangeListener { buttonView, isChecked ->
if (MainActivity.INSTANCE.started) {
WalletHelper.allowLegacyP2SH = isChecked
MainActivity.INSTANCE.prefs.edit().putBoolean("allowLegacyP2SH", WalletHelper.allowLegacyP2SH).apply()
}
}
this.addOpReturnSwitch.setOnCheckedChangeListener { buttonView, isChecked ->
if (MainActivity.INSTANCE.started) {
WalletHelper.addOpReturn = isChecked
MainActivity.INSTANCE.prefs.edit().putBoolean("addOpReturn", WalletHelper.addOpReturn).apply()
}
}
}
companion object {
}
}
package app.crescentcash.src.activity
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import app.crescentcash.src.MainActivity
import app.crescentcash.src.R
import app.crescentcash.src.manager.UIManager
import app.crescentcash.src.ui.UIHelper
import app.crescentcash.src.wallet.WalletHelper
import org.bitcoinj.crypto.KeyCrypterScrypt
import org.bitcoinj.utils.MonetaryFormat
import java.net.InetSocketAddress
import java.net.Proxy
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.util.*
class EncryptWalletActivity : AppCompatActivity() {
lateinit var encryptBtn: Button
lateinit var encryptionPassword: EditText
lateinit var encryptionPwdConfirm: EditText
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.setContentView(R.layout.encrypt_screen)
this.findViews()
this.prepareViews()
this.initListeners()
}
private fun prepareViews() {
UIManager.determineTheme(this)
}
private fun findViews() {
encryptBtn = this.findViewById(R.id.encryptBtn)
encryptionPassword = this.findViewById(R.id.encryptionPassword)
encryptionPwdConfirm = this.findViewById(R.id.encryptionPwdConfirm)
}
private fun initListeners() {
this.encryptBtn.setOnClickListener {
if (!TextUtils.isEmpty(encryptionPassword.text) && !TextUtils.isEmpty(encryptionPwdConfirm.text)) {
if (encryptionPassword.text.toString() == encryptionPwdConfirm.text.toString()) {
UIManager.showToastMessage(this, "Encrypting...")
val password = encryptionPassword.text.toString()
val scrypt = KeyCrypterScrypt(WalletHelper.SCRYPT_PARAMETERS)
val key = scrypt.deriveKey(password)
MainActivity.INSTANCE.walletHelper.wallet.encrypt(scrypt, key)
UIManager.showToastMessage(this, "Encrypted wallet!")
MainActivity.INSTANCE.walletHelper.aesKey = key
finish()
} else {
UIManager.showToastMessage(this, "Passwords do not match.")
}
} else {
UIManager.showToastMessage(this, "Please enter a password.")
}
}
}
companion object {
}
}
package app.crescentcash.src.activity
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.get
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import app.crescentcash.src.MainActivity
import app.crescentcash.src.R
import app.crescentcash.src.manager.AppManager
import app.crescentcash.src.manager.UIManager
import app.crescentcash.src.manager.WalletManager
import app.crescentcash.src.qr.QRHelper
import app.crescentcash.src.ui.NonScrollListView
import app.crescentcash.src.ui.UIHelper
import app.crescentcash.src.utils.Constants
import app.crescentcash.src.wallet.WalletHelper
import com.google.android.material.floatingactionbutton.FloatingActionButton
import org.bitcoinj.core.CashAddressFactory
import org.bitcoinj.core.ECKey
import org.bitcoinj.core.TransactionOutput
import org.bitcoinj.utils.MonetaryFormat
import org.bitcoinj.wallet.Wallet
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.util.*
class KeysListActivity : AppCompatActivity() {
private lateinit var srlKeys: SwipeRefreshLayout
private lateinit var keysList: NonScrollListView
lateinit var keyToImportText: EditText
private lateinit var btnImportKey: Button
private lateinit var btnImportKeyScan: ImageView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.setContentView(R.layout.keys_screen)
this.findViews()
this.prepareViews()
this.initListeners()
}
private fun prepareViews() {
UIManager.determineTheme(this)
}
private fun findViews() {
srlKeys = this.findViewById(R.id.srlKeys)
keysList = this.findViewById(R.id.keysList)
keyToImportText = this.findViewById(R.id.keyToImportText)
btnImportKey = this.findViewById(R.id.btnImportKey)
btnImportKeyScan = this.findViewById(R.id.btnImportKeyScan)
}
private fun initListeners() {
this.srlKeys.setOnRefreshListener { this.refreshKeys() }
this.btnImportKeyScan.setOnClickListener { UIManager.clickScanQR(this, Constants.REQUEST_CODE_IMPORT_SCAN) }
this.keysList.setOnItemClickListener { parent, view, position, id ->
WalletManager.currentEcKey = AppManager.walletManager.issuedKeysArrayList[position]["key"] ?: error("")
UIManager.startActivity(this, ManageKeyActivity::class.java)
}
this.btnImportKey.setOnClickListener {
if(!TextUtils.isEmpty(keyToImportText.text.toString())){
WalletManager.importPrivateKey(keyToImportText.text.toString())
keyToImportText.text = null
refreshKeys()
}
}
this.keysList.setOnItemLongClickListener { parent, view, position, id ->
val walletHelper = MainActivity.INSTANCE.walletHelper
val key = AppManager.walletManager.issuedKeysArrayList[position]["key"] ?: error("")
val clip = ClipData.newPlainText("Address", CashAddressFactory.create().getFromBase58(walletHelper.parameters, key.toAddress(walletHelper.parameters).toString()).toString())
val clipboard = MainActivity.INSTANCE.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
clipboard.setPrimaryClip(clip)
Toast.makeText(MainActivity.INSTANCE, "Copied address", Toast.LENGTH_SHORT).show()
true
}
}
fun refreshKeys() {
setKeysList()
if (srlKeys.isRefreshing) srlKeys.isRefreshing = false
}
private fun setKeysList() {
val walletHelper = MainActivity.INSTANCE.walletHelper
if (walletHelper.wallet.issuedReceiveKeys.isNotEmpty()) {
AppManager.walletManager.issuedKeysArrayList = ArrayList()
for(key in walletHelper.wallet.issuedReceiveKeys) {
val datum = HashMap<String, ECKey>()
datum["key"] = key
AppManager.walletManager.issuedKeysArrayList.add(datum)
}
for(key in walletHelper.wallet.importedKeys) {
val datum = HashMap<String, ECKey>()
datum["key"] = key
AppManager.walletManager.issuedKeysArrayList.add(datum)
}
val itemsAdapter = object : SimpleAdapter(this, AppManager.walletManager.issuedKeysArrayList, R.layout.key_cell, null, null) {
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
val view = LayoutInflater.from(parent.context).inflate(R.layout.key_cell, null)
val ecKey = AppManager.walletManager.issuedKeysArrayList[position]["key"]
if(ecKey != null) {
val legacyAddr = ecKey.toAddress(MainActivity.INSTANCE.walletHelper.parameters).toString()
val params = MainActivity.INSTANCE.walletHelper.parameters
val cashAddr = CashAddressFactory.create().getFromBase58(params, legacyAddr).toString().replace(params.cashAddrPrefix + ":", "")
val cashAcctInternal = MainActivity.INSTANCE.prefs.getString("cashacct_$legacyAddr", "")
val cashAcctTx = MainActivity.INSTANCE.prefs.getString("cashacct_tx_$legacyAddr", "")
if(position == 0) {
setCashAcctText(view, "")
} else {
if (cashAcctInternal.toString().endsWith("#???")) {
object : Thread() {
override fun run() {
val cashAcct = MainActivity.INSTANCE.netHelper.checkForCashAccount(ecKey, cashAcctTx.toString(), cashAcctInternal.toString().replace("#???", ""))
setCashAcctText(view, cashAcct)
}
}.start()
} else {
if (cashAcctInternal == "") {
object : Thread() {
override fun run() {
val cashAcct = MainActivity.INSTANCE.netHelper.reverseLookupCashAccount(cashAddr, legacyAddr)
setCashAcctText(view, cashAcct)
}
}.start()
} else {
val cashAcct = if (cashAcctInternal == "none_found") {
"No Cash Account"
} else {
cashAcctInternal
}
setCashAcctText(view, cashAcct!!)
}
}
}
setAddressText(view, cashAddr)
}
return view
}
}
this.runOnUiThread {
keysList.adapter = itemsAdapter
keysList.refreshDrawableState()
}
}
}
private fun setCashAcctText(view: View, cashAcct: String) {
val cashAcctTextView = view.findViewById(R.id.text2) as TextView
cashAcctTextView.text = cashAcct
if (UIHelper.nightModeEnabled) {
cashAcctTextView.setTextColor(Color.GRAY)
}
}
private fun setAddressText(view: View, cashAddr: String) {
val addressTextView = view.findViewById(R.id.text1) as TextView
addressTextView.text = cashAddr
if (UIHelper.nightModeEnabled) {
addressTextView.setTextColor(Color.WHITE)
} else {
addressTextView.setTextColor(Color.BLACK)
}
}
companion object {
}
}
package app.crescentcash.src.activity
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.get
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import app.crescentcash.src.MainActivity
import app.crescentcash.src.R
import app.crescentcash.src.manager.AppManager
import app.crescentcash.src.manager.UIManager
import app.crescentcash.src.manager.WalletManager
import app.crescentcash.src.qr.QRHelper
import app.crescentcash.src.ui.NonScrollListView
import app.crescentcash.src.ui.UIHelper
import app.crescentcash.src.utils.Constants
import app.crescentcash.src.wallet.WalletHelper
import com.google.android.material.floatingactionbutton.FloatingActionButton
import org.bitcoinj.core.CashAddressFactory
import org.bitcoinj.core.ECKey
import org.bitcoinj.core.TransactionOutput
import org.bitcoinj.utils.MonetaryFormat
import org.bitcoinj.wallet.Wallet
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.util.*
class ManageKeyActivity : AppCompatActivity() {
lateinit var messageToSignText: EditText
private lateinit var signMessageBtn: Button
lateinit var signatureText: TextView
private lateinit var btnCopyPrivateKey: Button
lateinit var newCashAcctName: EditText
private lateinit var registerCashAcctBtn: Button
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.setContentView(R.layout.manage_key_screen)
this.findViews()
this.prepareViews()
this.initListeners()
}
private fun prepareViews() {
UIManager.determineTheme(this)
}
private fun findViews() {
messageToSignText = this.findViewById(R.id.messageToSign)
signMessageBtn = this.findViewById(R.id.signMessageBtn)
signatureText = this.findViewById(R.id.msgSigText)
btnCopyPrivateKey = this.findViewById(R.id.btnCopyPrivateKey)
newCashAcctName = this.findViewById(R.id.newCashAcctName)
registerCashAcctBtn = this.findViewById(R.id.registerCashAcctBtn)
}
private fun initListeners() {
this.signMessageBtn.setOnClickListener {
if(!TextUtils.isEmpty(messageToSignText.text.toString())) {
val signature = WalletManager.signMessageWithKey(WalletManager.currentEcKey, messageToSignText.text.toString())
signatureText.text = signature
}
}
this.btnCopyPrivateKey.setOnClickListener {
val walletHelper = MainActivity.INSTANCE.walletHelper
val clip = ClipData.newPlainText("Address", WalletManager.currentEcKey.maybeDecrypt(walletHelper.aesKey).getPrivateKeyAsWiF(walletHelper.parameters))
val clipboard = MainActivity.INSTANCE.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
clipboard.setPrimaryClip(clip)
Toast.makeText(MainActivity.INSTANCE, "Copied private key", Toast.LENGTH_SHORT).show()
}
this.registerCashAcctBtn.setOnClickListener {
if(!TextUtils.isEmpty(newCashAcctName.text.toString())) {
val walletHelper = MainActivity.INSTANCE.walletHelper
val key = WalletManager.currentEcKey
val address = key.toAddress(walletHelper.parameters).toBase58()
val txHash = WalletManager.registerCashAccount(key, newCashAcctName.text.toString())
val editor = MainActivity.INSTANCE.prefs.edit()
editor.putString("cashacct_$address", "${newCashAcctName.text}#???")
editor.putString("cashacct_tx_$address", txHash)
editor.apply()
newCashAcctName.text = null
}
}
}
companion object {
}
}
package app.crescentcash.src.activity
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.get
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import app.crescentcash.src.MainActivity
import app.crescentcash.src.R
import app.crescentcash.src.manager.AppManager
import app.crescentcash.src.manager.UIManager
import app.crescentcash.src.manager.WalletManager
import app.crescentcash.src.qr.QRHelper
import app.crescentcash.src.ui.NonScrollListView
import app.crescentcash.src.ui.UIHelper
import app.crescentcash.src.utils.Constants
import app.crescentcash.src.wallet.WalletHelper
import com.google.android.material.floatingactionbutton.FloatingActionButton
import org.bitcoinj.core.CashAddressFactory
import org.bitcoinj.core.ECKey
import org.bitcoinj.core.TransactionOutput
import org.bitcoinj.utils.MonetaryFormat
import org.bitcoinj.wallet.Wallet
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.util.*
class UtxosListActivity : AppCompatActivity() {
private lateinit var srlUtxo: SwipeRefreshLayout
lateinit var utxosScreen: FrameLayout
private lateinit var utxoListView: NonScrollListView
private lateinit var btnSendUtxos: FloatingActionButton
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.setContentView(R.layout.utxos)
this.findViews()
this.prepareViews()
this.initListeners()
}
private fun prepareViews() {
UIManager.determineTheme(this)
}
private fun findViews() {
utxosScreen = this.findViewById(R.id.utxoWindow)
utxoListView = this.findViewById(R.id.utxoListView)
btnSendUtxos = this.findViewById(R.id.btnSendUtxos)
srlUtxo = this.findViewById(R.id.srlUtxos)
}
private fun initListeners() {
this.srlUtxo.setOnRefreshListener { this.setUtxoList(MainActivity.INSTANCE.walletHelper.wallet) }
this.btnSendUtxos.setOnClickListener {
this.utxosScreen.visibility = View.GONE
//this.displaySendWindow()
//TODO start send activity
}
this.utxoListView.choiceMode = ListView.CHOICE_MODE_MULTIPLE
this.utxoListView.setOnItemClickListener { parent, view, position, id ->
val cell: CheckedTextView = utxoListView[position].findViewById(R.id.text1)
cell.isChecked = !cell.isChecked
val utxo = AppManager.walletManager.utxoMap[position]["utxo"]
println("Selected utxo: $utxo")
if(cell.isChecked) {
WalletManager.selectedUtxos.add(utxo!!)
} else {
WalletManager.selectedUtxos.remove(utxo)
}
println(WalletManager.selectedUtxos.toString())
}
}
private fun setUtxoList(wallet: Wallet) {
setUtxoListView(wallet)
if (srlUtxo.isRefreshing) srlUtxo.isRefreshing = false
}
private fun setUtxoListView(wallet: Wallet?) {
if (wallet != null) {
val utxos = wallet.utxos
AppManager.walletManager.utxoMap.clear()
for (x in 0 until utxos.size) {
val utxo = utxos[x]
val utxoMapped = HashMap<String, TransactionOutput>()
utxoMapped["utxo"<