From 0d3745ebef7309af963b1e524160a62ef5a6e836 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 8 Jun 2026 18:07:22 +0200 Subject: [PATCH] Updated on 2026-08-14 --- .../main/res/drawable/ic_visa_in_banner.xml | 51 +++++++++++++++++++ .../tokendetails/ui/TokenDetailsScreen.kt | 14 +++-- .../utils/WalletWarningsAnalyticsSender.kt | 6 +-- .../domain/GetWalletNotificationsFactory.kt | 5 +- .../state/model/WalletNotificationUM.kt | 41 ++++++++++++--- 5 files changed, 102 insertions(+), 15 deletions(-) create mode 100644 core/ui/src/main/res/drawable/ic_visa_in_banner.xml diff --git a/core/ui/src/main/res/drawable/ic_visa_in_banner.xml b/core/ui/src/main/res/drawable/ic_visa_in_banner.xml new file mode 100644 index 0000000000..38b256dcf3 --- /dev/null +++ b/core/ui/src/main/res/drawable/ic_visa_in_banner.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/TokenDetailsScreen.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/TokenDetailsScreen.kt index 724f3b1e2e..a051b8688e 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/TokenDetailsScreen.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/TokenDetailsScreen.kt @@ -24,7 +24,6 @@ import com.tangem.common.ui.earn.EarnBlockUM import com.tangem.common.ui.expressStatus.state.ExpressTransactionStateUM import com.tangem.common.ui.expressStatus.state.ExpressTransactionsBlockState import com.tangem.common.ui.notifications.notifications -import com.tangem.core.ui.components.BottomFade import com.tangem.core.ui.components.containers.pullToRefresh.PullToRefreshConfig import com.tangem.core.ui.components.containers.pullToRefresh.TangemPullToRefreshSlidingContainer import com.tangem.core.ui.components.currency.icon.CurrencyIconState @@ -34,12 +33,13 @@ import com.tangem.core.ui.components.marketprice.MarketPriceBlockState import com.tangem.core.ui.components.topFade import com.tangem.core.ui.ds.button.TangemButtonType import com.tangem.core.ui.ds.button.TangemButtonUM +import com.tangem.core.ui.ds2.fade.TangemFade import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.extensions.themedColor import com.tangem.core.ui.res.LocalHazeState -import com.tangem.core.ui.test.TokenDetailsScreenTestTags import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreviewRedesign +import com.tangem.core.ui.test.TokenDetailsScreenTestTags import com.tangem.domain.models.account.CryptoPortfolioIcon import com.tangem.feature.tokendetails.presentation.tokendetails.state.* import com.tangem.feature.tokendetails.presentation.tokendetails.state.TokenDetailsTopAppBarUM.TitleState @@ -124,9 +124,13 @@ private fun BoxScope.TokenDetailsMarketBlockOverlay( ) { val density = LocalDensity.current - BottomFade( - backgroundColor = TangemTheme.colors2.surface.level2, - modifier = Modifier.align(Alignment.BottomCenter), + TangemFade( + variant = TangemFade.Variant.Hard, + position = TangemFade.Position.Bottom, + modifier = Modifier + .fillMaxWidth() + .height(174.dp) + .align(Alignment.BottomCenter), ) component.Content( 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 ad44ae8b6b..0b097d38b8 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,7 +6,6 @@ import com.tangem.core.analytics.models.AnalyticsParam import com.tangem.core.decompose.di.ModelScoped import com.tangem.domain.tangempay.TangemPayAnalyticsEvents import com.tangem.feature.wallet.child.wallet.model.WalletActivationBannerType -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.PushBanner import com.tangem.feature.wallet.presentation.wallet.state.model.* @@ -81,9 +80,9 @@ internal class WalletWarningsAnalyticsSender @Inject constructor( -> null is WalletNotification.FinishWalletActivation -> { val activationState = if (warning.isBackupExists) { - MainScreen.NoticeFinishActivation.ActivationState.Unfinished + NoticeFinishActivation.ActivationState.Unfinished } else { - MainScreen.NoticeFinishActivation.ActivationState.NotStarted + NoticeFinishActivation.ActivationState.NotStarted } val balanceState = when (warning.type) { WalletActivationBannerType.Attention -> AnalyticsParam.EmptyFull.Empty @@ -135,6 +134,7 @@ internal class WalletWarningsAnalyticsSender @Inject constructor( } is WalletNotificationUM.PushNotifications -> PushBanner() is WalletNotificationUM.AddFunds -> NoticeAddFunds() + is WalletNotificationUM.TangemPayPromo -> TangemPayAnalyticsEvents.PermanentBannerShowed() is WalletNotificationUM.UnlockWallets, is WalletNotificationUM.NoAccount, is WalletNotificationUM.LowSignatures, diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetWalletNotificationsFactory.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetWalletNotificationsFactory.kt index c4238c5988..0be111cadb 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetWalletNotificationsFactory.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/domain/GetWalletNotificationsFactory.kt @@ -255,7 +255,10 @@ internal class GetWalletNotificationsFactory @Inject constructor( onRefreshClick = { walletClickIntents.onRefreshPayToken(userWallet) }, shouldShowProgress = false, ) - is PaymentAccountStatusValue.NotCreated -> null // TODO(Main redesign) and analytics PermanentBannerShowed + is PaymentAccountStatusValue.NotCreated -> WalletNotificationUM.TangemPayPromo( + onLaterClick = { walletClickIntents.onOnboardingBannerCloseClick(userWallet.walletId) }, + onLearnMoreClick = { walletClickIntents.onOnboardingBannerClick(userWallet.walletId) }, + ) is PaymentAccountStatusValue.Error.Unavailable -> WalletNotificationUM.TangemPayUnreachable is PaymentAccountStatusValue.Error.CardIssueFailed, is PaymentAccountStatusValue.Error.ExposedDevice, diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotificationUM.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotificationUM.kt index bfd4e2b0ba..c366fb05ac 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotificationUM.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/state/model/WalletNotificationUM.kt @@ -7,7 +7,10 @@ import com.tangem.core.ui.ds.image.TangemIconUM import com.tangem.core.ui.ds.message.TangemMessageButtonUM import com.tangem.core.ui.ds.message.TangemMessageEffect import com.tangem.core.ui.ds.message.TangemMessageUM -import com.tangem.core.ui.extensions.* +import com.tangem.core.ui.extensions.TextReference +import com.tangem.core.ui.extensions.pluralReference +import com.tangem.core.ui.extensions.resourceReference +import com.tangem.core.ui.extensions.wrappedList import com.tangem.core.ui.res.TangemTheme import com.tangem.feature.wallet.impl.R import kotlinx.collections.immutable.persistentListOf @@ -52,8 +55,8 @@ internal sealed class WalletNotificationUM(val messageUM: TangemMessageUM, val t data object UsedOutdatedData : WalletNotificationUM( messageUM = TangemMessageUM( id = "UsedOutdatedDataNotification", - title = resourceReference(com.tangem.core.res.R.string.warning_outdated_data_title), - subtitle = resourceReference(com.tangem.core.res.R.string.warning_outdated_data_message), + title = resourceReference(R.string.warning_outdated_data_title), + subtitle = resourceReference(R.string.warning_outdated_data_message), iconUM = TangemIconUM.Icon( iconRes = R.drawable.ic_error_sync_default_24, tintReference = { TangemTheme.colors2.graphic.status.attention }, @@ -383,6 +386,32 @@ internal sealed class WalletNotificationUM(val messageUM: TangemMessageUM, val t type = WalletNotificationType.Promo, ) + data class TangemPayPromo( + private val onLaterClick: () -> Unit, + private val onLearnMoreClick: () -> Unit, + ) : WalletNotificationUM( + messageUM = TangemMessageUM( + id = "TangemPayPromo", + iconUM = TangemIconUM.Image(imageRes = R.drawable.ic_visa_in_banner), + title = resourceReference(id = R.string.tangempay_onboarding_banner_title), + subtitle = resourceReference(id = R.string.tangempay_get_banner_description), + buttonsUM = persistentListOf( + TangemMessageButtonUM( + text = resourceReference(id = R.string.common_later), + onClick = onLaterClick, + type = TangemButtonType.Secondary, + ), + TangemMessageButtonUM( + text = resourceReference(id = R.string.common_learn_more), + onClick = onLearnMoreClick, + type = TangemButtonType.Primary, + ), + ), + messageEffect = TangemMessageEffect.None, + ), + type = WalletNotificationType.Promo, + ) + // endregion // region Survey @@ -448,8 +477,8 @@ internal sealed class WalletNotificationUM(val messageUM: TangemMessageUM, val t ) : WalletNotificationUM( messageUM = TangemMessageUM( id = "CloreMigrationNotification", - title = resourceReference(com.tangem.core.res.R.string.warning_clore_migration_title), - subtitle = resourceReference(com.tangem.core.res.R.string.warning_clore_migration_description), + title = resourceReference(R.string.warning_clore_migration_title), + subtitle = resourceReference(R.string.warning_clore_migration_description), iconUM = TangemIconUM.Icon( iconRes = R.drawable.ic_attention_default_24, tintReference = { TangemTheme.colors2.graphic.status.attention }, @@ -457,7 +486,7 @@ internal sealed class WalletNotificationUM(val messageUM: TangemMessageUM, val t messageEffect = TangemMessageEffect.None, buttonsUM = persistentListOf( TangemMessageButtonUM( - text = resourceReference(com.tangem.core.res.R.string.warning_clore_migration_button), + text = resourceReference(R.string.warning_clore_migration_button), onClick = onStartMigrationClick, type = TangemButtonType.Secondary, ),