From 855d23a4e388b6286ae390b7b4f6fb2755828ce6 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 10 Dec 2025 15:46:19 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../common/ui/navigationButtons/NavigationButtonsBlock.kt | 6 ++++-- .../com/tangem/common/ui/navigationButtons/NavigationUM.kt | 1 + .../features/send/v2/send/confirm/model/SendConfirmModel.kt | 1 + .../send/v2/send/success/model/SendConfirmSuccessModel.kt | 1 + .../send/v2/sendnft/confirm/model/NFTSendConfirmModel.kt | 3 ++- .../send/v2/sendnft/success/model/NFTSendSuccessModel.kt | 1 + .../send/v2/subcomponents/amount/model/SendAmountModel.kt | 1 + .../subcomponents/destination/model/SendDestinationModel.kt | 2 ++ .../features/swap/v2/impl/amount/model/SwapAmountModel.kt | 1 + .../sendviaswap/confirm/model/SendWithSwapConfirmModel.kt | 1 + .../sendviaswap/success/model/SendWithSwapSuccessModel.kt | 2 ++ .../sendviaswap/success/ui/SendWithSwapSuccessContent.kt | 2 ++ 12 files changed, 19 insertions(+), 3 deletions(-) diff --git a/common/ui/src/main/java/com/tangem/common/ui/navigationButtons/NavigationButtonsBlock.kt b/common/ui/src/main/java/com/tangem/common/ui/navigationButtons/NavigationButtonsBlock.kt index 47233d7291..1941c34ff9 100644 --- a/common/ui/src/main/java/com/tangem/common/ui/navigationButtons/NavigationButtonsBlock.kt +++ b/common/ui/src/main/java/com/tangem/common/ui/navigationButtons/NavigationButtonsBlock.kt @@ -35,8 +35,8 @@ import com.tangem.core.ui.extensions.isNullOrEmpty import com.tangem.core.ui.extensions.resolveReference import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview -import com.tangem.core.ui.utils.singleEvent import com.tangem.core.ui.test.SendScreenTestTags +import com.tangem.core.ui.utils.singleEvent @Composable fun NavigationButtonsBlock( @@ -78,7 +78,9 @@ fun NavigationButtonsBlockV2( horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing12), ) { PreviousButton(navigationUM?.prevButton) - NavigationPrimaryButton(navigationUM?.primaryButton, modifier = Modifier.weight(1f)) + key(navigationUM?.source) { + NavigationPrimaryButton(navigationUM?.primaryButton, modifier = Modifier.weight(1f)) + } } } } diff --git a/common/ui/src/main/java/com/tangem/common/ui/navigationButtons/NavigationUM.kt b/common/ui/src/main/java/com/tangem/common/ui/navigationButtons/NavigationUM.kt index dcde9ac935..dc1953b1d9 100644 --- a/common/ui/src/main/java/com/tangem/common/ui/navigationButtons/NavigationUM.kt +++ b/common/ui/src/main/java/com/tangem/common/ui/navigationButtons/NavigationUM.kt @@ -7,6 +7,7 @@ import com.tangem.core.ui.extensions.TextReference @Immutable sealed class NavigationUM { data class Content( + val source: String, val title: TextReference, val subtitle: TextReference?, @DrawableRes val backIconRes: Int, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/model/SendConfirmModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/model/SendConfirmModel.kt index 0fb799cf17..5c00ee1e19 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/model/SendConfirmModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/model/SendConfirmModel.kt @@ -523,6 +523,7 @@ internal class SendConfirmModel @Inject constructor( params.callback.onResult( state.copy( navigationUM = NavigationUM.Content( + source = CommonSendRoute.Confirm.javaClass.simpleName, title = resourceReference(id = R.string.common_send), subtitle = null, backIconRes = when (confirmUM) { diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/success/model/SendConfirmSuccessModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/success/model/SendConfirmSuccessModel.kt index 0d6a56bba6..29d2b390d8 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/success/model/SendConfirmSuccessModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/success/model/SendConfirmSuccessModel.kt @@ -52,6 +52,7 @@ internal class SendConfirmSuccessModel @Inject constructor( params.callback.onResult( state.copy( navigationUM = NavigationUM.Content( + source = CommonSendRoute.ConfirmSuccess.javaClass.simpleName, title = stringReference(""), subtitle = null, backIconRes = R.drawable.ic_close_24, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/confirm/model/NFTSendConfirmModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/confirm/model/NFTSendConfirmModel.kt index aab81e8c77..1c7c92bc7e 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/confirm/model/NFTSendConfirmModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/confirm/model/NFTSendConfirmModel.kt @@ -371,11 +371,12 @@ internal class NFTSendConfirmModel @Inject constructor( flow = uiState, flow2 = params.currentRoute, transform = { state, route -> state to route }, - ).onEach { (state, _) -> + ).onEach { (state, route) -> val confirmUM = state.confirmUM params.callback.onResult( state.copy( navigationUM = NavigationUM.Content( + source = CommonSendRoute.Confirm.javaClass.simpleName, title = resourceReference(R.string.nft_send), subtitle = null, backIconRes = when (confirmUM) { diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/success/model/NFTSendSuccessModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/success/model/NFTSendSuccessModel.kt index 7fc3951005..92c860fb82 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/success/model/NFTSendSuccessModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/success/model/NFTSendSuccessModel.kt @@ -50,6 +50,7 @@ internal class NFTSendSuccessModel @Inject constructor( params.callback.onResult( state.copy( navigationUM = NavigationUM.Content( + source = CommonSendRoute.ConfirmSuccess.javaClass.simpleName, title = stringReference(""), subtitle = null, backIconRes = R.drawable.ic_close_24, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt index 7926083e2e..9be514d748 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt @@ -378,6 +378,7 @@ internal class SendAmountModel @Inject constructor( setSendWithSwapAvailability() params.callback.onNavigationResult( NavigationUM.Content( + source = CommonSendRoute.Amount::class.java.simpleName, title = resourceReference(R.string.send_amount_label), subtitle = null, backIconRes = if (route.isEditMode) { diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt index becc704e91..5870afd0fb 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt @@ -35,6 +35,7 @@ import com.tangem.features.send.v2.api.entity.PredefinedValues import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponentParams import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponentParams.DestinationBlockParams import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM +import com.tangem.features.send.v2.common.CommonSendRoute import com.tangem.features.send.v2.impl.R import com.tangem.features.send.v2.subcomponents.destination.analytics.EnterAddressSource import com.tangem.features.send.v2.subcomponents.destination.analytics.SendDestinationAnalyticEvents @@ -359,6 +360,7 @@ internal class SendDestinationModel @Inject constructor( ).onEach { (state, route) -> params.callback.onNavigationResult( NavigationUM.Content( + source = CommonSendRoute.Destination::class.java.simpleName, title = params.title, subtitle = null, backIconRes = if (route.isEditMode) { diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt index 70fe7d5312..da46d20b3f 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt @@ -720,6 +720,7 @@ internal class SwapAmountModel @Inject constructor( ).filter { (_, route) -> route is SendWithSwapRoute.Amount }.onEach { (state, route) -> params.callback.onNavigationResult( NavigationUM.Content( + source = SendWithSwapRoute.Amount::class.java.simpleName, title = resourceReference(R.string.common_amount), subtitle = null, backIconRes = if (route.isEditMode) { diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt index 8d04b3d804..c0d119b50f 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/model/SendWithSwapConfirmModel.kt @@ -428,6 +428,7 @@ internal class SendWithSwapConfirmModel @Inject constructor( route = SendWithSwapRoute.Confirm, sendWithSwapUM = state.copy( navigationUM = NavigationUM.Content( + source = SendWithSwapRoute.Confirm.javaClass.simpleName, title = resourceReference(id = R.string.send_with_swap_confirm_title), subtitle = null, backIconRes = R.drawable.ic_back_24, diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/success/model/SendWithSwapSuccessModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/success/model/SendWithSwapSuccessModel.kt index 33909f7563..6b743b5db5 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/success/model/SendWithSwapSuccessModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/success/model/SendWithSwapSuccessModel.kt @@ -12,6 +12,7 @@ import com.tangem.core.ui.extensions.TextReference import com.tangem.core.ui.extensions.resourceReference import com.tangem.features.swap.v2.impl.R import com.tangem.features.swap.v2.impl.common.entity.ConfirmUM +import com.tangem.features.swap.v2.impl.sendviaswap.SendWithSwapRoute import com.tangem.features.swap.v2.impl.sendviaswap.entity.SendWithSwapUM import com.tangem.features.swap.v2.impl.sendviaswap.success.SendWithSwapSuccessComponent import com.tangem.utils.coroutines.CoroutineDispatcherProvider @@ -40,6 +41,7 @@ internal class SendWithSwapSuccessModel @Inject constructor( private fun configConfirmSuccessNavigation() { params.callback.onNavigationResult( NavigationUM.Content( + source = SendWithSwapRoute.Success.javaClass.simpleName, title = TextReference.EMPTY, subtitle = null, backIconRes = R.drawable.ic_close_24, diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/success/ui/SendWithSwapSuccessContent.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/success/ui/SendWithSwapSuccessContent.kt index c948e842c3..0ccf5aada7 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/success/ui/SendWithSwapSuccessContent.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/success/ui/SendWithSwapSuccessContent.kt @@ -55,6 +55,7 @@ import com.tangem.features.swap.v2.impl.amount.entity.SwapAmountUM import com.tangem.features.swap.v2.impl.amount.ui.preview.SwapAmountContentPreview import com.tangem.features.swap.v2.impl.common.entity.ConfirmUM import com.tangem.features.swap.v2.impl.common.entity.SwapQuoteUM +import com.tangem.features.swap.v2.impl.sendviaswap.SendWithSwapRoute import com.tangem.features.swap.v2.impl.sendviaswap.entity.SendWithSwapUM import kotlinx.collections.immutable.persistentListOf import java.math.BigDecimal @@ -368,6 +369,7 @@ private fun SendWithSwapSuccessContent_Preview() { ), ), navigationUM = NavigationUM.Content( + source = SendWithSwapRoute.Success.javaClass.simpleName, title = TextReference.EMPTY, subtitle = null, backIconRes = R.drawable.ic_close_24,