From 61f2412cb56138063da20b431d0cb4f01de6190d Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 12 Sep 2025 12:52:38 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../start/AddExistingWalletStartModel.kt | 16 ++++++++++++++++ .../start/entity/AddExistingWalletStartUM.kt | 1 + .../start/ui/AddExistingWalletStartContent.kt | 10 +++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/AddExistingWalletStartModel.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/AddExistingWalletStartModel.kt index 9f56cce80b..e39dd4adbb 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/AddExistingWalletStartModel.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/AddExistingWalletStartModel.kt @@ -65,6 +65,7 @@ internal class AddExistingWalletStartModel @Inject constructor( internal val uiState: StateFlow field = MutableStateFlow( AddExistingWalletStartUM( + showWantToPurchaseBlock = false, isScanInProgress = false, onBackClick = params.callbacks::onBackClick, onImportPhraseClick = params.callbacks::onImportPhraseClick, @@ -73,6 +74,17 @@ internal class AddExistingWalletStartModel @Inject constructor( ), ) + init { + showWantToPurchaseBlockWithDelay() + } + + private fun showWantToPurchaseBlockWithDelay() { + modelScope.launch { + delay(SHOW_WANT_TO_PURCHASE_BLOCK_DELAY) + uiState.update { it.copy(showWantToPurchaseBlock = true) } + } + } + private fun onShopClick() { analyticsEventHandler.send(IntroductionProcess.ButtonBuyCards) analyticsEventHandler.send(Shop.ScreenOpened) @@ -180,4 +192,8 @@ internal class AddExistingWalletStartModel @Inject constructor( ), ) } + + companion object { + private const val SHOW_WANT_TO_PURCHASE_BLOCK_DELAY = 3000L + } } \ No newline at end of file diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/entity/AddExistingWalletStartUM.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/entity/AddExistingWalletStartUM.kt index 37a5113f35..c448d2c471 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/entity/AddExistingWalletStartUM.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/entity/AddExistingWalletStartUM.kt @@ -1,6 +1,7 @@ package com.tangem.features.hotwallet.addexistingwallet.start.entity internal data class AddExistingWalletStartUM( + val showWantToPurchaseBlock: Boolean, val isScanInProgress: Boolean, val onBackClick: () -> Unit, val onImportPhraseClick: () -> Unit, diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/ui/AddExistingWalletStartContent.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/ui/AddExistingWalletStartContent.kt index 184f5f924f..42588c81de 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/ui/AddExistingWalletStartContent.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/addexistingwallet/start/ui/AddExistingWalletStartContent.kt @@ -1,6 +1,7 @@ package com.tangem.features.hotwallet.addexistingwallet.start.ui import android.content.res.Configuration +import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.material3.CircularProgressIndicator @@ -127,9 +128,11 @@ internal fun AddExistingWalletStartContent(state: AddExistingWalletStartUM, modi enabled = false, ) } - BuyTangemWalletBlock( - onScanClick = state.onBuyCardClick, - ) + AnimatedVisibility(state.showWantToPurchaseBlock) { + BuyTangemWalletBlock( + onScanClick = state.onBuyCardClick, + ) + } } } @@ -176,6 +179,7 @@ private fun PreviewCreateWalletContent() { TangemThemePreview { AddExistingWalletStartContent( state = AddExistingWalletStartUM( + showWantToPurchaseBlock = true, isScanInProgress = true, onBackClick = {}, onImportPhraseClick = {},