From 06d083b283a539e8a2dc3715dcfbfa15262235d6 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 11 Aug 2025 16:36:04 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../common/ui/amountScreen/ui/AmountBlockV2.kt | 12 ++++++++---- .../DefaultChooseManagedTokensComponent.kt | 1 + .../amount/model/SendAmountAlertFactory.kt | 12 ++++++------ .../subcomponents/destination/ui/DestinationBlock.kt | 9 +++++---- .../v2/impl/amount/model/SwapAmountAlertFactory.kt | 11 ++++------- .../swap/v2/impl/amount/model/SwapAmountModel.kt | 2 +- .../model/SwapChooseTokenAlertFactory.kt | 12 ++++-------- .../success/ui/SendWithSwapSuccessContent.kt | 9 ++++++--- 8 files changed, 35 insertions(+), 33 deletions(-) diff --git a/common/ui/src/main/java/com/tangem/common/ui/amountScreen/ui/AmountBlockV2.kt b/common/ui/src/main/java/com/tangem/common/ui/amountScreen/ui/AmountBlockV2.kt index b9fa864b84..ee080d579f 100644 --- a/common/ui/src/main/java/com/tangem/common/ui/amountScreen/ui/AmountBlockV2.kt +++ b/common/ui/src/main/java/com/tangem/common/ui/amountScreen/ui/AmountBlockV2.kt @@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.unit.dp import com.tangem.common.ui.amountScreen.models.AmountState import com.tangem.common.ui.amountScreen.preview.AmountStatePreviewData +import com.tangem.core.ui.components.ResizableText import com.tangem.core.ui.components.SpacerWMax import com.tangem.core.ui.components.currency.icon.CurrencyIcon import com.tangem.core.ui.components.currency.icon.CurrencyIconState @@ -24,6 +25,7 @@ import com.tangem.core.ui.extensions.resolveReference import com.tangem.core.ui.format.bigdecimal.crypto import com.tangem.core.ui.format.bigdecimal.fiat import com.tangem.core.ui.format.bigdecimal.format +import com.tangem.core.ui.format.bigdecimal.uncapped import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @@ -43,7 +45,7 @@ fun AmountBlockV2( crypto( symbol = "", decimals = amount.cryptoAmount.decimals, - ) + ).uncapped() }.orEmpty() val fiatAmount = amount.fiatAmount.value.format { @@ -102,7 +104,7 @@ private fun AmountBlockV2( Row { Text( text = title.resolveReference(), - style = TangemTheme.typography.body2, + style = TangemTheme.typography.subtitle2, color = TangemTheme.colors.text.tertiary, ) SpacerWMax() @@ -121,18 +123,20 @@ private fun AmountBlockV2( verticalArrangement = Arrangement.spacedBy(4.dp), modifier = Modifier.padding(top = 8.dp), ) { - Text( + ResizableText( text = firstAmount, style = TangemTheme.typography.h2, color = TangemTheme.colors.text.primary1, + maxLines = 1, ) Row( horizontalArrangement = Arrangement.spacedBy(4.dp), ) { - Text( + ResizableText( text = secondAmount, style = TangemTheme.typography.body2, color = TangemTheme.colors.text.tertiary, + maxLines = 1, ) extraContent() } diff --git a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/choosetoken/DefaultChooseManagedTokensComponent.kt b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/choosetoken/DefaultChooseManagedTokensComponent.kt index 1ff16dac71..7b18b4dc84 100644 --- a/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/choosetoken/DefaultChooseManagedTokensComponent.kt +++ b/features/manage-tokens/impl/src/main/kotlin/com/tangem/features/managetokens/choosetoken/DefaultChooseManagedTokensComponent.kt @@ -72,6 +72,7 @@ internal class DefaultChooseManagedTokensComponent @AssistedInject constructor( cryptoCurrency = cryptoCurrency, shouldResetNavigation = params.selectedCurrency != null, ) + model.bottomSheetNavigation.dismiss() params.callback?.onResult() ?: router.pop() } }, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountAlertFactory.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountAlertFactory.kt index dadd0ea67c..f4373fe4b9 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountAlertFactory.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountAlertFactory.kt @@ -2,9 +2,10 @@ package com.tangem.features.send.v2.subcomponents.amount.model import com.tangem.core.decompose.di.ModelScoped import com.tangem.core.decompose.ui.UiMessageSender -import com.tangem.core.ui.extensions.stringReference +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.message.DialogMessage import com.tangem.core.ui.message.EventMessageAction +import com.tangem.features.send.v2.impl.R import javax.inject.Inject @ModelScoped @@ -13,20 +14,19 @@ internal class SendAmountAlertFactory @Inject constructor( ) { fun showResetSendingAlert(onConfirm: () -> Unit) { - // todo fix localization [REDACTED_TASK_KEY] uiMessageSender.send( DialogMessage( - title = stringReference("Confirm Convert"), - message = stringReference("Proceed with conversion? Previous data will be reset."), + title = resourceReference(R.string.send_with_swap_convert_token_alert_title), + message = resourceReference(R.string.send_with_swap_convert_token_alert_message), firstActionBuilder = { EventMessageAction( - title = stringReference("Confirm"), + title = resourceReference(R.string.common_confirm), onClick = onConfirm, ) }, secondActionBuilder = { EventMessageAction( - title = stringReference("Not Now"), + title = resourceReference(R.string.common_not_now), onClick = onDismissRequest, ) }, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/ui/DestinationBlock.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/ui/DestinationBlock.kt index e1c1b5da9f..b3807ec5db 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/ui/DestinationBlock.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/ui/DestinationBlock.kt @@ -18,6 +18,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import com.tangem.core.ui.components.icons.identicon.IdentIcon import com.tangem.core.ui.extensions.TextReference import com.tangem.core.ui.extensions.resolveReference +import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @@ -62,7 +63,7 @@ private fun AddressBlock(address: DestinationTextFieldUM.RecipientAddress) { Text( text = address.label.resolveReference(), style = TangemTheme.typography.subtitle2, - color = TangemTheme.colors.text.secondary, + color = TangemTheme.colors.text.tertiary, ) Row( verticalAlignment = Alignment.CenterVertically, @@ -104,7 +105,7 @@ private fun MemoBlock(memo: DestinationTextFieldUM.RecipientMemo?) { Text( text = memo.label.resolveReference(), style = TangemTheme.typography.subtitle2, - color = TangemTheme.colors.text.secondary, + color = TangemTheme.colors.text.tertiary, ) Text( text = memo.value, @@ -121,7 +122,7 @@ private fun AddressWithMemoBlock( memo: DestinationTextFieldUM.RecipientMemo?, ) { Text( - text = stringResourceSafe(R.string.send_to_address), + text = stringResourceSafe(R.string.send_recipient), style = TangemTheme.typography.subtitle2, color = TangemTheme.colors.text.tertiary, ) @@ -188,7 +189,7 @@ private class DestinationBlockPreviewProvider : PreviewParameterProvider Unit) { - // todo fix localization [REDACTED_TASK_KEY] uiMessageSender.send( DialogMessage( - title = stringReference("Confirm cancellation"), - message = stringReference( - "Are you sure you want to cancel the conversion? After changing, previous data will be reset.", - ), + title = resourceReference(R.string.send_with_swap_remove_convert_alert_title), + message = resourceReference(R.string.send_with_swap_remove_convert_alert_message), firstActionBuilder = { EventMessageAction( - title = stringReference("Confirm"), + title = resourceReference(R.string.common_confirm), onClick = onConfirm, ) }, secondActionBuilder = { EventMessageAction( - title = stringReference("Not Now"), + title = resourceReference(R.string.common_not_now), onClick = onDismissRequest, ) }, 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 5973ba9c7d..fb4748b307 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 @@ -661,7 +661,7 @@ internal class SwapAmountModel @Inject constructor( ).onEach { (state, route) -> params.callback.onNavigationResult( NavigationUM.Content( - title = resourceReference(R.string.common_swap), + title = resourceReference(R.string.common_amount), subtitle = null, backIconRes = if (route.isEditMode) { R.drawable.ic_back_24 diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/choosetoken/fromSupported/model/SwapChooseTokenAlertFactory.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/choosetoken/fromSupported/model/SwapChooseTokenAlertFactory.kt index 70433b8957..c7605a26cc 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/choosetoken/fromSupported/model/SwapChooseTokenAlertFactory.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/choosetoken/fromSupported/model/SwapChooseTokenAlertFactory.kt @@ -3,7 +3,6 @@ package com.tangem.features.swap.v2.impl.choosetoken.fromSupported.model import com.tangem.core.decompose.di.ModelScoped import com.tangem.core.decompose.ui.UiMessageSender import com.tangem.core.ui.extensions.resourceReference -import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.message.DialogMessage import com.tangem.core.ui.message.EventMessageAction import com.tangem.features.swap.v2.impl.R @@ -26,22 +25,19 @@ internal class SwapChooseTokenAlertFactory @Inject constructor( } fun showChangeTokenAlert(onConfirm: () -> Unit, onDismiss: () -> Unit) { - // todo fix localization [REDACTED_TASK_KEY] uiMessageSender.send( DialogMessage( - title = stringReference("Changing token"), - message = stringReference( - "Are you sure you want to change the token? After changing, previous data will be reset.", - ), + title = resourceReference(R.string.send_with_swap_change_token_alert_title), + message = resourceReference(R.string.send_with_swap_change_token_alert_message), firstActionBuilder = { EventMessageAction( - title = stringReference("Change"), + title = resourceReference(R.string.common_change), onClick = onConfirm, ) }, secondActionBuilder = { EventMessageAction( - title = stringReference("Cancel"), + title = resourceReference(R.string.common_cancel), onClick = onDismiss, ) }, 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 e730666446..2ad404315d 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 @@ -125,9 +125,12 @@ internal fun SendWithSwapSuccessContent(sendWithSwapUM: SendWithSwapUM) { ), ), ) - .padding(top = 24.dp) - .padding(horizontal = 16.dp), - + .padding( + top = 24.dp, + bottom = 12.dp, + start = 16.dp, + end = 16.dp, + ), ) } }