Updated on 2026-08-14
This commit is contained in:
parent
e2f9d50499
commit
855d23a4e3
12 changed files with 19 additions and 3 deletions
|
|
@ -35,8 +35,8 @@ import com.tangem.core.ui.extensions.isNullOrEmpty
|
||||||
import com.tangem.core.ui.extensions.resolveReference
|
import com.tangem.core.ui.extensions.resolveReference
|
||||||
import com.tangem.core.ui.res.TangemTheme
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
import com.tangem.core.ui.res.TangemThemePreview
|
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.test.SendScreenTestTags
|
||||||
|
import com.tangem.core.ui.utils.singleEvent
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun NavigationButtonsBlock(
|
fun NavigationButtonsBlock(
|
||||||
|
|
@ -78,7 +78,9 @@ fun NavigationButtonsBlockV2(
|
||||||
horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing12),
|
horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing12),
|
||||||
) {
|
) {
|
||||||
PreviousButton(navigationUM?.prevButton)
|
PreviousButton(navigationUM?.prevButton)
|
||||||
NavigationPrimaryButton(navigationUM?.primaryButton, modifier = Modifier.weight(1f))
|
key(navigationUM?.source) {
|
||||||
|
NavigationPrimaryButton(navigationUM?.primaryButton, modifier = Modifier.weight(1f))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.tangem.core.ui.extensions.TextReference
|
||||||
@Immutable
|
@Immutable
|
||||||
sealed class NavigationUM {
|
sealed class NavigationUM {
|
||||||
data class Content(
|
data class Content(
|
||||||
|
val source: String,
|
||||||
val title: TextReference,
|
val title: TextReference,
|
||||||
val subtitle: TextReference?,
|
val subtitle: TextReference?,
|
||||||
@DrawableRes val backIconRes: Int,
|
@DrawableRes val backIconRes: Int,
|
||||||
|
|
|
||||||
|
|
@ -523,6 +523,7 @@ internal class SendConfirmModel @Inject constructor(
|
||||||
params.callback.onResult(
|
params.callback.onResult(
|
||||||
state.copy(
|
state.copy(
|
||||||
navigationUM = NavigationUM.Content(
|
navigationUM = NavigationUM.Content(
|
||||||
|
source = CommonSendRoute.Confirm.javaClass.simpleName,
|
||||||
title = resourceReference(id = R.string.common_send),
|
title = resourceReference(id = R.string.common_send),
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = when (confirmUM) {
|
backIconRes = when (confirmUM) {
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ internal class SendConfirmSuccessModel @Inject constructor(
|
||||||
params.callback.onResult(
|
params.callback.onResult(
|
||||||
state.copy(
|
state.copy(
|
||||||
navigationUM = NavigationUM.Content(
|
navigationUM = NavigationUM.Content(
|
||||||
|
source = CommonSendRoute.ConfirmSuccess.javaClass.simpleName,
|
||||||
title = stringReference(""),
|
title = stringReference(""),
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = R.drawable.ic_close_24,
|
backIconRes = R.drawable.ic_close_24,
|
||||||
|
|
|
||||||
|
|
@ -371,11 +371,12 @@ internal class NFTSendConfirmModel @Inject constructor(
|
||||||
flow = uiState,
|
flow = uiState,
|
||||||
flow2 = params.currentRoute,
|
flow2 = params.currentRoute,
|
||||||
transform = { state, route -> state to route },
|
transform = { state, route -> state to route },
|
||||||
).onEach { (state, _) ->
|
).onEach { (state, route) ->
|
||||||
val confirmUM = state.confirmUM
|
val confirmUM = state.confirmUM
|
||||||
params.callback.onResult(
|
params.callback.onResult(
|
||||||
state.copy(
|
state.copy(
|
||||||
navigationUM = NavigationUM.Content(
|
navigationUM = NavigationUM.Content(
|
||||||
|
source = CommonSendRoute.Confirm.javaClass.simpleName,
|
||||||
title = resourceReference(R.string.nft_send),
|
title = resourceReference(R.string.nft_send),
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = when (confirmUM) {
|
backIconRes = when (confirmUM) {
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ internal class NFTSendSuccessModel @Inject constructor(
|
||||||
params.callback.onResult(
|
params.callback.onResult(
|
||||||
state.copy(
|
state.copy(
|
||||||
navigationUM = NavigationUM.Content(
|
navigationUM = NavigationUM.Content(
|
||||||
|
source = CommonSendRoute.ConfirmSuccess.javaClass.simpleName,
|
||||||
title = stringReference(""),
|
title = stringReference(""),
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = R.drawable.ic_close_24,
|
backIconRes = R.drawable.ic_close_24,
|
||||||
|
|
|
||||||
|
|
@ -378,6 +378,7 @@ internal class SendAmountModel @Inject constructor(
|
||||||
setSendWithSwapAvailability()
|
setSendWithSwapAvailability()
|
||||||
params.callback.onNavigationResult(
|
params.callback.onNavigationResult(
|
||||||
NavigationUM.Content(
|
NavigationUM.Content(
|
||||||
|
source = CommonSendRoute.Amount::class.java.simpleName,
|
||||||
title = resourceReference(R.string.send_amount_label),
|
title = resourceReference(R.string.send_amount_label),
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = if (route.isEditMode) {
|
backIconRes = if (route.isEditMode) {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponentParams.DestinationBlockParams
|
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.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.impl.R
|
||||||
import com.tangem.features.send.v2.subcomponents.destination.analytics.EnterAddressSource
|
import com.tangem.features.send.v2.subcomponents.destination.analytics.EnterAddressSource
|
||||||
import com.tangem.features.send.v2.subcomponents.destination.analytics.SendDestinationAnalyticEvents
|
import com.tangem.features.send.v2.subcomponents.destination.analytics.SendDestinationAnalyticEvents
|
||||||
|
|
@ -359,6 +360,7 @@ internal class SendDestinationModel @Inject constructor(
|
||||||
).onEach { (state, route) ->
|
).onEach { (state, route) ->
|
||||||
params.callback.onNavigationResult(
|
params.callback.onNavigationResult(
|
||||||
NavigationUM.Content(
|
NavigationUM.Content(
|
||||||
|
source = CommonSendRoute.Destination::class.java.simpleName,
|
||||||
title = params.title,
|
title = params.title,
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = if (route.isEditMode) {
|
backIconRes = if (route.isEditMode) {
|
||||||
|
|
|
||||||
|
|
@ -720,6 +720,7 @@ internal class SwapAmountModel @Inject constructor(
|
||||||
).filter { (_, route) -> route is SendWithSwapRoute.Amount }.onEach { (state, route) ->
|
).filter { (_, route) -> route is SendWithSwapRoute.Amount }.onEach { (state, route) ->
|
||||||
params.callback.onNavigationResult(
|
params.callback.onNavigationResult(
|
||||||
NavigationUM.Content(
|
NavigationUM.Content(
|
||||||
|
source = SendWithSwapRoute.Amount::class.java.simpleName,
|
||||||
title = resourceReference(R.string.common_amount),
|
title = resourceReference(R.string.common_amount),
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = if (route.isEditMode) {
|
backIconRes = if (route.isEditMode) {
|
||||||
|
|
|
||||||
|
|
@ -428,6 +428,7 @@ internal class SendWithSwapConfirmModel @Inject constructor(
|
||||||
route = SendWithSwapRoute.Confirm,
|
route = SendWithSwapRoute.Confirm,
|
||||||
sendWithSwapUM = state.copy(
|
sendWithSwapUM = state.copy(
|
||||||
navigationUM = NavigationUM.Content(
|
navigationUM = NavigationUM.Content(
|
||||||
|
source = SendWithSwapRoute.Confirm.javaClass.simpleName,
|
||||||
title = resourceReference(id = R.string.send_with_swap_confirm_title),
|
title = resourceReference(id = R.string.send_with_swap_confirm_title),
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = R.drawable.ic_back_24,
|
backIconRes = R.drawable.ic_back_24,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.tangem.core.ui.extensions.TextReference
|
||||||
import com.tangem.core.ui.extensions.resourceReference
|
import com.tangem.core.ui.extensions.resourceReference
|
||||||
import com.tangem.features.swap.v2.impl.R
|
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.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.entity.SendWithSwapUM
|
||||||
import com.tangem.features.swap.v2.impl.sendviaswap.success.SendWithSwapSuccessComponent
|
import com.tangem.features.swap.v2.impl.sendviaswap.success.SendWithSwapSuccessComponent
|
||||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||||
|
|
@ -40,6 +41,7 @@ internal class SendWithSwapSuccessModel @Inject constructor(
|
||||||
private fun configConfirmSuccessNavigation() {
|
private fun configConfirmSuccessNavigation() {
|
||||||
params.callback.onNavigationResult(
|
params.callback.onNavigationResult(
|
||||||
NavigationUM.Content(
|
NavigationUM.Content(
|
||||||
|
source = SendWithSwapRoute.Success.javaClass.simpleName,
|
||||||
title = TextReference.EMPTY,
|
title = TextReference.EMPTY,
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = R.drawable.ic_close_24,
|
backIconRes = R.drawable.ic_close_24,
|
||||||
|
|
|
||||||
|
|
@ -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.amount.ui.preview.SwapAmountContentPreview
|
||||||
import com.tangem.features.swap.v2.impl.common.entity.ConfirmUM
|
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.common.entity.SwapQuoteUM
|
||||||
|
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.entity.SendWithSwapUM
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import java.math.BigDecimal
|
import java.math.BigDecimal
|
||||||
|
|
@ -368,6 +369,7 @@ private fun SendWithSwapSuccessContent_Preview() {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
navigationUM = NavigationUM.Content(
|
navigationUM = NavigationUM.Content(
|
||||||
|
source = SendWithSwapRoute.Success.javaClass.simpleName,
|
||||||
title = TextReference.EMPTY,
|
title = TextReference.EMPTY,
|
||||||
subtitle = null,
|
subtitle = null,
|
||||||
backIconRes = R.drawable.ic_close_24,
|
backIconRes = R.drawable.ic_close_24,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue