diff --git a/core/datasource/src/main/java/com/tangem/datasource/local/preferences/PreferencesKeys.kt b/core/datasource/src/main/java/com/tangem/datasource/local/preferences/PreferencesKeys.kt index 544a55357f..eae141d861 100644 --- a/core/datasource/src/main/java/com/tangem/datasource/local/preferences/PreferencesKeys.kt +++ b/core/datasource/src/main/java/com/tangem/datasource/local/preferences/PreferencesKeys.kt @@ -132,6 +132,18 @@ object PreferencesKeys { val ACCESS_CODE_SKIPPED_STATES_KEY by lazy { stringPreferencesKey(name = "accessCodeSkippedStates") } + val SHOULD_SHOW_UPGRADE_BANNER_KEY by lazy { stringPreferencesKey(name = "shouldShowUpgradeBanner") } + + val SHOULD_SHOW_NEXT_TIME_UPGRADE_BANNER_KEY by lazy { + stringPreferencesKey(name = "shouldShowNextTimeUpgradeBanner") + } + + val UPGRADE_BANNER_CLOSURE_TIMESTAMP_KEY by lazy { stringPreferencesKey(name = "upgradeBannerClosureTimestamp") } + + val WALLET_CREATION_TIMESTAMP_KEY by lazy { stringPreferencesKey(name = "walletCreationTimestamp") } + + val HAS_HAD_FIRST_TOP_UP_KEY by lazy { stringPreferencesKey(name = "hasHadFirstTopUp") } + // region Notifications val NOTIFICATIONS_APPLICATION_ID_KEY by lazy { stringPreferencesKey(name = "notificationsApplicationId") } diff --git a/core/ui/src/main/res/drawable-hdpi/img_tangem_wallet_72.webp b/core/ui/src/main/res/drawable-hdpi/img_tangem_wallet_72.webp new file mode 100644 index 0000000000..a82e95d6ad Binary files /dev/null and b/core/ui/src/main/res/drawable-hdpi/img_tangem_wallet_72.webp differ diff --git a/core/ui/src/main/res/drawable-mdpi/img_tangem_wallet_72.webp b/core/ui/src/main/res/drawable-mdpi/img_tangem_wallet_72.webp new file mode 100644 index 0000000000..bdfc895e3c Binary files /dev/null and b/core/ui/src/main/res/drawable-mdpi/img_tangem_wallet_72.webp differ diff --git a/core/ui/src/main/res/drawable-xhdpi/img_tangem_wallet_72.webp b/core/ui/src/main/res/drawable-xhdpi/img_tangem_wallet_72.webp new file mode 100644 index 0000000000..31d50c1c29 Binary files /dev/null and b/core/ui/src/main/res/drawable-xhdpi/img_tangem_wallet_72.webp differ diff --git a/core/ui/src/main/res/drawable-xxhdpi/img_tangem_wallet_72.webp b/core/ui/src/main/res/drawable-xxhdpi/img_tangem_wallet_72.webp new file mode 100644 index 0000000000..0fcc24fc07 Binary files /dev/null and b/core/ui/src/main/res/drawable-xxhdpi/img_tangem_wallet_72.webp differ diff --git a/core/ui/src/main/res/drawable-xxxhdpi/img_tangem_wallet_72.webp b/core/ui/src/main/res/drawable-xxxhdpi/img_tangem_wallet_72.webp new file mode 100644 index 0000000000..16beaaee0d Binary files /dev/null and b/core/ui/src/main/res/drawable-xxxhdpi/img_tangem_wallet_72.webp differ diff --git a/data/hot-wallet/src/main/java/com/tangem/data/hotwallet/DefaultHotWalletRepository.kt b/data/hot-wallet/src/main/java/com/tangem/data/hotwallet/DefaultHotWalletRepository.kt index 5754358efa..686f94579d 100644 --- a/data/hot-wallet/src/main/java/com/tangem/data/hotwallet/DefaultHotWalletRepository.kt +++ b/data/hot-wallet/src/main/java/com/tangem/data/hotwallet/DefaultHotWalletRepository.kt @@ -5,6 +5,7 @@ import androidx.annotation.ChecksSdkIntAtLeast import com.tangem.datasource.local.preferences.AppPreferencesStore import com.tangem.datasource.local.preferences.PreferencesKeys import com.tangem.datasource.local.preferences.utils.getObjectMap +import com.tangem.datasource.local.preferences.utils.getObjectMapSync import com.tangem.domain.hotwallet.repository.HotWalletRepository import com.tangem.domain.models.wallet.UserWalletId import kotlinx.coroutines.flow.Flow @@ -34,4 +35,79 @@ internal class DefaultHotWalletRepository( ) } } + + override fun shouldShowUpgradeBanner(userWalletId: UserWalletId): Flow = appPreferencesStore + .getObjectMap(PreferencesKeys.SHOULD_SHOW_UPGRADE_BANNER_KEY) + .map { it[userWalletId.stringValue] == true } + + override suspend fun setShouldShowUpgradeBanner(userWalletId: UserWalletId, shouldShow: Boolean) { + appPreferencesStore.editData { mutablePreferences -> + mutablePreferences.setObjectMap( + key = PreferencesKeys.SHOULD_SHOW_UPGRADE_BANNER_KEY, + value = mutablePreferences.getObjectMap(PreferencesKeys.SHOULD_SHOW_UPGRADE_BANNER_KEY) + .plus(userWalletId.stringValue to shouldShow), + ) + } + } + + override fun shouldShowNextTimeUpgradeBanner(userWalletId: UserWalletId): Flow = appPreferencesStore + .getObjectMap(PreferencesKeys.SHOULD_SHOW_NEXT_TIME_UPGRADE_BANNER_KEY) + .map { it[userWalletId.stringValue] == true } + + override suspend fun setShouldShowNextTimeUpgradeBanner(userWalletId: UserWalletId, shouldShow: Boolean) { + appPreferencesStore.editData { mutablePreferences -> + mutablePreferences.setObjectMap( + key = PreferencesKeys.SHOULD_SHOW_NEXT_TIME_UPGRADE_BANNER_KEY, + value = mutablePreferences.getObjectMap( + PreferencesKeys.SHOULD_SHOW_NEXT_TIME_UPGRADE_BANNER_KEY, + ) + .plus(userWalletId.stringValue to shouldShow), + ) + } + } + + override suspend fun getUpgradeBannerClosureTimestamp(userWalletId: UserWalletId): Long? { + return appPreferencesStore + .getObjectMapSync(PreferencesKeys.UPGRADE_BANNER_CLOSURE_TIMESTAMP_KEY)[userWalletId.stringValue] + } + + override suspend fun setUpgradeBannerClosureTimestamp(userWalletId: UserWalletId, timestamp: Long) { + appPreferencesStore.editData { mutablePreferences -> + mutablePreferences.setObjectMap( + key = PreferencesKeys.UPGRADE_BANNER_CLOSURE_TIMESTAMP_KEY, + value = mutablePreferences.getObjectMap(PreferencesKeys.UPGRADE_BANNER_CLOSURE_TIMESTAMP_KEY) + .plus(userWalletId.stringValue to timestamp), + ) + } + } + + override suspend fun getWalletCreationTimestamp(userWalletId: UserWalletId): Long? { + return appPreferencesStore + .getObjectMapSync(PreferencesKeys.WALLET_CREATION_TIMESTAMP_KEY)[userWalletId.stringValue] + } + + override suspend fun setWalletCreationTimestamp(userWalletId: UserWalletId, timestamp: Long) { + appPreferencesStore.editData { mutablePreferences -> + mutablePreferences.setObjectMap( + key = PreferencesKeys.WALLET_CREATION_TIMESTAMP_KEY, + value = mutablePreferences.getObjectMap(PreferencesKeys.WALLET_CREATION_TIMESTAMP_KEY) + .plus(userWalletId.stringValue to timestamp), + ) + } + } + + override suspend fun hasHadFirstTopUp(userWalletId: UserWalletId): Boolean { + return appPreferencesStore + .getObjectMapSync(PreferencesKeys.HAS_HAD_FIRST_TOP_UP_KEY)[userWalletId.stringValue] == true + } + + override suspend fun setHasHadFirstTopUp(userWalletId: UserWalletId, hasTopUp: Boolean) { + appPreferencesStore.editData { mutablePreferences -> + mutablePreferences.setObjectMap( + key = PreferencesKeys.HAS_HAD_FIRST_TOP_UP_KEY, + value = mutablePreferences.getObjectMap(PreferencesKeys.HAS_HAD_FIRST_TOP_UP_KEY) + .plus(userWalletId.stringValue to hasTopUp), + ) + } + } } \ No newline at end of file diff --git a/domain/hot-wallet/src/main/kotlin/com/tangem/domain/hotwallet/repository/HotWalletRepository.kt b/domain/hot-wallet/src/main/kotlin/com/tangem/domain/hotwallet/repository/HotWalletRepository.kt index e228cd4419..2432bc3dc9 100644 --- a/domain/hot-wallet/src/main/kotlin/com/tangem/domain/hotwallet/repository/HotWalletRepository.kt +++ b/domain/hot-wallet/src/main/kotlin/com/tangem/domain/hotwallet/repository/HotWalletRepository.kt @@ -12,4 +12,24 @@ interface HotWalletRepository { fun accessCodeSkipped(userWalletId: UserWalletId): Flow suspend fun setAccessCodeSkipped(userWalletId: UserWalletId, skipped: Boolean) + + fun shouldShowUpgradeBanner(userWalletId: UserWalletId): Flow + + suspend fun setShouldShowUpgradeBanner(userWalletId: UserWalletId, shouldShow: Boolean) + + fun shouldShowNextTimeUpgradeBanner(userWalletId: UserWalletId): Flow + + suspend fun setShouldShowNextTimeUpgradeBanner(userWalletId: UserWalletId, shouldShow: Boolean) + + suspend fun getUpgradeBannerClosureTimestamp(userWalletId: UserWalletId): Long? + + suspend fun setUpgradeBannerClosureTimestamp(userWalletId: UserWalletId, timestamp: Long) + + suspend fun getWalletCreationTimestamp(userWalletId: UserWalletId): Long? + + suspend fun setWalletCreationTimestamp(userWalletId: UserWalletId, timestamp: Long) + + suspend fun hasHadFirstTopUp(userWalletId: UserWalletId): Boolean + + suspend fun setHasHadFirstTopUp(userWalletId: UserWalletId, hasTopUp: Boolean) } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/intents/WalletWarningsClickIntents.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/intents/WalletWarningsClickIntents.kt index 0dd7d1af6f..ca5a2d4caa 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/intents/WalletWarningsClickIntents.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/intents/WalletWarningsClickIntents.kt @@ -17,6 +17,7 @@ import com.tangem.domain.common.wallets.UserWalletsListRepository import com.tangem.domain.feedback.GetWalletMetaInfoUseCase import com.tangem.domain.feedback.SendFeedbackEmailUseCase import com.tangem.domain.feedback.models.FeedbackEmailType +import com.tangem.domain.hotwallet.repository.HotWalletRepository import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.models.wallet.UserWallet @@ -98,6 +99,10 @@ internal interface WalletWarningsClickIntents { fun onFinishWalletActivationClick(isBackupExists: Boolean) fun onYieldPromoTermsAndConditionsClick() + + fun onUpgradeHotWalletClick(userWalletId: UserWalletId) + + fun onCloseUpgradeBannerClick(userWalletId: UserWalletId) } @Suppress("LargeClass", "LongParameterList", "TooManyFunctions") @@ -130,6 +135,7 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor( private val getWalletsListForEnablingUseCase: GetWalletsForAutomaticallyPushEnablingUseCase, private val uiMessageSender: UiMessageSender, private val reviewManager: ReviewManager, + private val hotWalletRepository: HotWalletRepository, ) : BaseWalletClickIntents(), WalletWarningsClickIntents { override fun onAddBackupCardClick() { @@ -544,6 +550,34 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor( urlOpener.openUrl(YIELD_PROMO_TERMS_LINK) } + override fun onUpgradeHotWalletClick(userWalletId: UserWalletId) { + modelScope.launch(dispatchers.main) { + val userWallet = getUserWalletUseCase(userWalletId).getOrNull() + if (userWallet is UserWallet.Hot) { + hotWalletRepository.setShouldShowUpgradeBanner(userWalletId, false) + hotWalletRepository.setShouldShowNextTimeUpgradeBanner(userWalletId, false) + appRouter.push(UpgradeWallet(userWalletId)) + } + } + } + + override fun onCloseUpgradeBannerClick(userWalletId: UserWalletId) { + modelScope.launch(dispatchers.main) { + val userWallet = getUserWalletUseCase(userWalletId).getOrNull() + if (userWallet is UserWallet.Hot) { + val hasHadFirstTopUp = hotWalletRepository.hasHadFirstTopUp(userWalletId) + val currentTime = System.currentTimeMillis() + + if (hasHadFirstTopUp) { + hotWalletRepository.setShouldShowUpgradeBanner(userWalletId, false) + hotWalletRepository.setUpgradeBannerClosureTimestamp(userWalletId, currentTime) + } else { + hotWalletRepository.setShouldShowUpgradeBanner(userWalletId, true) + } + } + } + } + private companion object { const val VISA_PROMO_LINK = "https://tangem.com/en/cardwaitlist/?utm_source=tangem-app-banner" + "&utm_medium=banner" + diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt index 3852ada00e..341c2c6726 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/WalletWarningsAnalyticsSender.kt @@ -6,8 +6,9 @@ import com.tangem.core.analytics.models.AnalyticsParam import com.tangem.core.decompose.di.ModelScoped import com.tangem.domain.tokens.model.analytics.PromoAnalyticsEvent.* import com.tangem.feature.wallet.child.wallet.model.WalletActivationBannerType -import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.MainScreen +import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.MainScreen.* +import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.PushBannerPromo.* import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotification import com.tangem.feature.wallet.presentation.wallet.state.model.WalletState import com.tangem.feature.wallet.presentation.wallet.utils.ScreenLifecycleProvider @@ -40,16 +41,16 @@ internal class WalletWarningsAnalyticsSender @Inject constructor( @Suppress("CyclomaticComplexMethod") private fun getEvent(warning: WalletNotification): AnalyticsEvent? { return when (warning) { - is WalletNotification.Critical.DevCard -> MainScreen.DevelopmentCard() - is WalletNotification.Critical.FailedCardValidation -> MainScreen.ProductSampleCard() - is WalletNotification.Warning.MissingBackup -> MainScreen.BackupYourWallet() - is WalletNotification.Warning.NumberOfSignedHashesIncorrect -> MainScreen.CardSignedTransactions() - is WalletNotification.Warning.TestNetCard -> MainScreen.TestnetCard() - is WalletNotification.Informational.DemoCard -> MainScreen.DemoCard() - is WalletNotification.Informational.MissingAddresses -> MainScreen.MissingAddresses() - is WalletNotification.RateApp -> MainScreen.HowDoYouLikeTangem() - is WalletNotification.Critical.BackupError -> MainScreen.BackupError() - is WalletNotification.NoteMigration -> MainScreen.NotePromo() + is WalletNotification.Critical.DevCard -> DevelopmentCard() + is WalletNotification.Critical.FailedCardValidation -> ProductSampleCard() + is WalletNotification.Warning.MissingBackup -> BackupYourWallet() + is WalletNotification.Warning.NumberOfSignedHashesIncorrect -> CardSignedTransactions() + is WalletNotification.Warning.TestNetCard -> TestnetCard() + is WalletNotification.Informational.DemoCard -> DemoCard() + is WalletNotification.Informational.MissingAddresses -> MissingAddresses() + is WalletNotification.RateApp -> HowDoYouLikeTangem() + is WalletNotification.Critical.BackupError -> BackupError() + is WalletNotification.NoteMigration -> NotePromo() is WalletNotification.SwapPromo -> NoticePromotionBanner( source = AnalyticsParam.ScreensSources.Main, program = Program.Empty, // Use it on new promo action @@ -92,16 +93,17 @@ internal class WalletWarningsAnalyticsSender @Inject constructor( WalletActivationBannerType.Attention -> AnalyticsParam.EmptyFull.Empty WalletActivationBannerType.Warning -> AnalyticsParam.EmptyFull.Full } - MainScreen.NoticeFinishActivation( + NoticeFinishActivation( activationState = activationState, balanceState = balanceState, ) } - is WalletNotification.Critical.SeedPhraseNotification -> MainScreen.NoticeSeedPhraseSupport() - is WalletNotification.Critical.SeedPhraseSecondNotification -> MainScreen.NoticeSeedPhraseSupportSecond() - is WalletNotification.PushNotifications -> WalletScreenAnalyticsEvent.PushBannerPromo.PushBanner() + is WalletNotification.Critical.SeedPhraseNotification -> NoticeSeedPhraseSupport() + is WalletNotification.Critical.SeedPhraseSecondNotification -> NoticeSeedPhraseSupportSecond() + is WalletNotification.PushNotifications -> PushBanner() is WalletNotification.Warning.TangemPayRefreshNeeded -> null - WalletNotification.Warning.TangemPayUnreachable -> null + is WalletNotification.Warning.TangemPayUnreachable -> null + is WalletNotification.UpgradeHotWalletPromo -> null } } } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetMultiWalletWarningsFactory.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetMultiWalletWarningsFactory.kt index 6381c3f6a4..6f8e6b1be6 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetMultiWalletWarningsFactory.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetMultiWalletWarningsFactory.kt @@ -14,6 +14,7 @@ import com.tangem.domain.core.lce.Lce import com.tangem.domain.core.lce.LceFlow import com.tangem.domain.demo.IsDemoCardUseCase import com.tangem.domain.hotwallet.GetAccessCodeSkippedUseCase +import com.tangem.domain.hotwallet.repository.HotWalletRepository import com.tangem.domain.models.StatusSource import com.tangem.domain.models.TotalFiatBalance import com.tangem.domain.models.currency.CryptoCurrency @@ -43,6 +44,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map +import java.util.concurrent.TimeUnit import javax.inject.Inject @Suppress("LongParameterList", "LargeClass") @@ -58,6 +60,7 @@ internal class GetMultiWalletWarningsFactory @Inject constructor( private val notificationsRepository: NotificationsRepository, private val accountDependencies: AccountDependencies, private val getAccessCodeSkippedUseCase: GetAccessCodeSkippedUseCase, + private val hotWalletRepository: HotWalletRepository, ) { @Suppress("UNCHECKED_CAST", "MagicNumber", "LongMethod") @@ -98,6 +101,8 @@ internal class GetMultiWalletWarningsFactory @Inject constructor( getAccessCodeSkippedUseCase(userWallet.walletId).distinctUntilChanged(), shouldShowPromoWalletUseCase(userWalletId = userWallet.walletId, promoId = PromoId.YieldPromo) .distinctUntilChanged(), + hotWalletRepository.shouldShowUpgradeBanner(userWallet.walletId).distinctUntilChanged(), + hotWalletRepository.shouldShowNextTimeUpgradeBanner(userWallet.walletId).distinctUntilChanged(), ) { array -> array } .combine(tokenListFlow()) { array, any: Any -> arrayOf(any).plus(elements = array) } .map { array -> @@ -111,12 +116,22 @@ internal class GetMultiWalletWarningsFactory @Inject constructor( val shouldShowEnablePushesReminderNotification = array[5] as Boolean val shouldAccessCodeSkipped = array[6] as Boolean val shouldShowYieldPromo = array[7] as Boolean + val shouldShowUpgradeBanner = array[8] as Boolean + val shouldShowNextTimeUpgradeBanner = array[9] as Boolean buildList { addUsedOutdatedDataNotification(totalFiatBalance) addCriticalNotifications(userWallet, seedPhraseIssueStatus, clickIntents) + addUpgradeHotWalletPromoNotification( + userWallet = userWallet, + flattenCurrencies = flattenCurrencies, + clickIntents = clickIntents, + shouldShowUpgradeBanner = shouldShowUpgradeBanner, + shouldShowNextTimeUpgradeBanner = shouldShowNextTimeUpgradeBanner, + ) + addFinishWalletActivationNotification( userWallet = userWallet, flattenCurrencies = flattenCurrencies, @@ -449,7 +464,57 @@ internal class GetMultiWalletWarningsFactory @Inject constructor( ) } + @Suppress("CyclomaticComplexMethod") + private suspend fun MutableList.addUpgradeHotWalletPromoNotification( + userWallet: UserWallet, + flattenCurrencies: Lce>, + clickIntents: WalletClickIntents, + shouldShowUpgradeBanner: Boolean, + shouldShowNextTimeUpgradeBanner: Boolean, + ) { + if (userWallet !is UserWallet.Hot) return + + val currentTime = System.currentTimeMillis() + val creationTimestamp = hotWalletRepository.getWalletCreationTimestamp(userWallet.walletId) + val closureTimestamp = hotWalletRepository.getUpgradeBannerClosureTimestamp(userWallet.walletId) + val hasHadFirstTopUp = hotWalletRepository.hasHadFirstTopUp(userWallet.walletId) + + if (creationTimestamp == null) { + hotWalletRepository.setWalletCreationTimestamp(userWallet.walletId, currentTime) + return + } + + val daysSinceCreation = TimeUnit.MILLISECONDS.toDays(currentTime - creationTimestamp) + val daysSinceClosure = closureTimestamp?.let { TimeUnit.MILLISECONDS.toDays(currentTime - it) } + + val currencies = flattenCurrencies.getOrNull(isPartialContentAccepted = true).orEmpty() + val hasBalance = currencies.any { it.value.amount.orZero().isPositive() } + + if (hasBalance && !hasHadFirstTopUp) { + hotWalletRepository.setHasHadFirstTopUp(userWallet.walletId, true) + } + + val shouldShow = when { + shouldShowUpgradeBanner && hasBalance -> true + shouldShowNextTimeUpgradeBanner && daysSinceClosure != null && daysSinceClosure >= UPGRADE_BANNER_RESHOW_DAYS -> true + !shouldShowUpgradeBanner && !shouldShowNextTimeUpgradeBanner && hasHadFirstTopUp && daysSinceCreation >= UPGRADE_BANNER_RESHOW_DAYS -> { + hotWalletRepository.setShouldShowNextTimeUpgradeBanner(userWallet.walletId, true) + true + } + else -> false + } + + addIf( + element = WalletNotification.UpgradeHotWalletPromo( + onLaterClick = { clickIntents.onCloseUpgradeBannerClick(userWallet.walletId) }, + onUpgradeClick = { clickIntents.onUpgradeHotWalletClick(userWallet.walletId) }, + ), + condition = shouldShow, + ) + } + private companion object { const val MAX_REMAINING_SIGNATURES_COUNT = 10 + const val UPGRADE_BANNER_RESHOW_DAYS = 30 } } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotification.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotification.kt index 9abf719a45..ed1601ae6a 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotification.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotification.kt @@ -445,4 +445,22 @@ sealed class WalletNotification(val config: NotificationConfig) { ), ), ) + + data class UpgradeHotWalletPromo( + val onLaterClick: () -> Unit, + val onUpgradeClick: () -> Unit, + ) : WalletNotification( + config = NotificationConfig( + title = resourceReference(R.string.hw_upgrade_to_cold_banner_title), + subtitle = resourceReference(R.string.hw_upgrade_to_cold_banner_description), + iconResId = R.drawable.img_tangem_wallet_72, + buttonsState = ButtonsState.PairButtonsConfig( + primaryText = resourceReference(R.string.hw_upgrade), + onPrimaryClick = onUpgradeClick, + secondaryText = resourceReference(R.string.common_later), + onSecondaryClick = onLaterClick, + ), + iconSize = 72.dp, + ), + ) } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletNotifications.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletNotifications.kt index d8b52ad1ad..90fc34c41f 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletNotifications.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletNotifications.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.lazy.items import androidx.compose.ui.Modifier import com.tangem.core.ui.components.notifications.NoteMigrationNotification import com.tangem.core.ui.components.notifications.Notification +import com.tangem.core.ui.res.ForceDarkTheme import com.tangem.core.ui.res.TangemTheme import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotification import kotlinx.collections.immutable.ImmutableList @@ -40,6 +41,14 @@ internal fun LazyListScope.notifications(configs: ImmutableList { + ForceDarkTheme { + Notification( + config = item.config, + modifier = modifier.animateItem(fadeInSpec = null, fadeOutSpec = null), + ) + } + } else -> { Notification( config = item.config,