Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-20 11:51:21 +03:00
commit af9893acd6
14 changed files with 81 additions and 46 deletions

View file

@ -431,29 +431,16 @@ internal class WalletModel @Inject constructor(
action.selectedWalletIndex
}
/*
* Should not show scroll animation if WalletScreen isn't in the background.
* Example, reset card
*/
if (screenLifecycleProvider.isBackgroundState.value) {
updateStateByDeleteWalletTransformer(
selectedWalletIndex = newSelectedWalletIndex,
deletedWalletId = action.deletedWalletId,
)
} else {
withContext(dispatchers.io) { delay(timeMillis = 1000) }
scrollToWallet(
prevIndex = action.deletedWalletIndex,
newIndex = action.selectedWalletIndex,
onConsume = {
updateStateByDeleteWalletTransformer(
selectedWalletIndex = newSelectedWalletIndex,
deletedWalletId = action.deletedWalletId,
)
},
)
}
scrollToWallet(
prevIndex = action.deletedWalletIndex,
newIndex = action.selectedWalletIndex,
onConsume = {
updateStateByDeleteWalletTransformer(
selectedWalletIndex = newSelectedWalletIndex,
deletedWalletId = action.deletedWalletId,
)
},
)
}
private fun updateStateByDeleteWalletTransformer(selectedWalletIndex: Int, deletedWalletId: UserWalletId) {
@ -485,15 +472,20 @@ internal class WalletModel @Inject constructor(
}
private fun scrollToWallet(prevIndex: Int, newIndex: Int, onConsume: () -> Unit = {}) {
stateHolder.update(
ScrollToWalletTransformer(
prevIndex = prevIndex,
newIndex = newIndex,
currentStateProvider = Provider(action = stateHolder::value),
stateUpdater = { newState -> stateHolder.update { newState } },
onConsume = onConsume,
),
)
// Should not show scroll animation if WalletScreen isn't in the background.
if (screenLifecycleProvider.isBackgroundState.value) {
onConsume()
} else {
stateHolder.update(
ScrollToWalletTransformer(
prevIndex = prevIndex,
newIndex = newIndex,
currentStateProvider = Provider(action = stateHolder::value),
stateUpdater = { newState -> stateHolder.update { newState } },
onConsume = onConsume,
),
)
}
}
inner class AskBiometryModelCallbacks : AskBiometryComponent.ModelCallbacks {

View file

@ -49,6 +49,12 @@ internal enum class Wallet2CobrandImage(
batchIds = setOf("AF33"),
),
BitcoinPizza2(
cards2ResId = R.drawable.ill_pizza_day2_card2_120_106,
cards3ResId = R.drawable.ill_pizza_day2_card3_120_106,
batchIds = setOf("AF990019"),
),
BTC365(
cards2ResId = R.drawable.ill_btc365_card2_120_106,
cards3ResId = R.drawable.ill_btc365_card3_120_106,
@ -67,6 +73,12 @@ internal enum class Wallet2CobrandImage(
batchIds = setOf("BB000013"),
),
Chilliz(
cards2ResId = R.drawable.ill_chilliz_card2_120_106,
cards3ResId = R.drawable.ill_chilliz_card3_120_106,
batchIds = setOf("BB000016"),
),
CoinMetrica(
cards2ResId = R.drawable.ill_coin_metrica_card2_120_106,
cards3ResId = R.drawable.ill_coin_metrica_card3_120_106,
@ -206,6 +218,12 @@ internal enum class Wallet2CobrandImage(
batchIds = setOf("AF43", "AF44", "AF45", "AF78", "AF79", "AF80"),
),
RamenCat(
cards2ResId = R.drawable.ill_ramen_cat_cards2_120_106,
cards3ResId = R.drawable.ill_ramen_cat_cards3_120_106,
batchIds = setOf("AF990006", "AF990007", "AF990008"),
),
RedPanda(
cards2ResId = R.drawable.ill_red_panda_card2_120_106,
cards3ResId = R.drawable.ill_red_panda_card3_120_106,
@ -218,6 +236,12 @@ internal enum class Wallet2CobrandImage(
batchIds = setOf("BB000012"),
),
Sakura(
cards2ResId = R.drawable.ill_sakura_card2_120_106,
cards3ResId = R.drawable.ill_sakura_card3_120_106,
batchIds = setOf("AF990029", "AF990030", "AF990031"),
),
SatoshiFriends(
cards2ResId = R.drawable.ill_satoshi_card2_120_106,
cards3ResId = R.drawable.ill_satoshi_card3_120_106,

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB