Updated on 2026-08-14

This commit is contained in:
Tangem 2020-04-10 13:27:47 +03:00
parent 9d6185b945
commit 25d005a9b9
3 changed files with 18 additions and 19 deletions

View file

@ -166,12 +166,13 @@ class PersonalizationConfigToItems : ModelToItems<PersonalizationConfig> {
private fun common(): ItemGroup {
val block = createGroup(BlockId.Common)
mutableListOf(
Common.Curve,
Common.Blockchain,
Common.BlockchainCustom,
Common.Curve,
Common.MaxSignatures,
Common.CreateWallet
).forEach { createItem(block, it) }
Common.CreateWallet,
Pins.PauseBeforePin2
).forEach { createItem(block, it as Id) }
return block
}
@ -279,8 +280,12 @@ class PersonalizationConfigToItems : ModelToItems<PersonalizationConfig> {
private fun pins(): ItemGroup {
val block = createGroup(BlockId.Pins)
mutableListOf(Pins.Pin, Pins.Pin2, Pins.Pin3, Pins.Cvc, Pins.PauseBeforePin2)
.forEach { createItem(block, it) }
mutableListOf(
Pins.Pin,
Pins.Pin2,
Pins.Pin3,
Pins.Cvc
).forEach { createItem(block, it) }
return block
}

View file

@ -15,8 +15,8 @@ class PersonalizationConfig {
var curveID = "ed25519"
var blockchain = "BTC/test"
var blockchainCustom = ""
var MaxSignatures: Long = 100
var createWallet = false
var MaxSignatures: Long = 999999
var createWallet = true
// Signing method
var SigningMethod0 = true
@ -62,7 +62,7 @@ class PersonalizationConfig {
var allowSwapPIN = true
var allowSwapPIN2 = true
var forbidDefaultPIN = false
var smartSecurityDelay = false
var smartSecurityDelay = true
var protectIssuerDataAgainstReplay = true
var skipSecurityDelayIfValidatedByIssuer = true
var skipCheckPIN2andCVCIfValidatedByIssuer = true
@ -88,15 +88,8 @@ class PersonalizationConfig {
var PIN2 = "000"
var PIN3 = ""
var CVC = "000"
var pauseBeforePIN2: Long = 15000
var pauseBeforePIN2: Long = 5000L
// not used
// var count: Long = 20
// var numberFormat = ""
// var issuerData = null
// var releaseVersion = false
// var issuerName = "TANGEM SDK"
}
class CardData {

View file

@ -41,7 +41,7 @@ class SpinnerWidget(
val name = view.findViewById<TextView>(R.id.tv_name)
name.text = getName()
spinner.adapter = spAdapter
spAdapter.getItemPosition(stringOf(viewModel.selectedItem))?.let {
spAdapter.getItemPosition(viewModel.selectedItem)?.let {
spinner.setSelection(it)
}
spinner.onItemSelectedListener = onItemSelectedListener
@ -87,8 +87,9 @@ class SpItemAdapter(list: List<KeyValue>?) : BaseAdapter() {
override fun getCount(): Int = itemList.size
fun getItemPosition(item: String): Int? {
val kv = itemList.firstOrNull { it.value == item } ?: return null
fun getItemPosition(item: Any?): Int? {
val selectedValue = item ?: return null
val kv = itemList.firstOrNull { it.value == selectedValue } ?: return null
return itemList.indexOf(kv)
}
}