From 3bd91a49a128d5d6e827d2efd9a058d486b2ac39 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 15 Dec 2025 13:20:48 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../com/tangem/core/ui/components/Dialogs.kt | 3 ++- .../ui/CreateWalletSelectionContent.kt | 16 ++++++++++++---- .../hotwallet/accesscode/AccessCodeModel.kt | 5 +++++ .../features/hotwallet/common/ui/OptionBlock.kt | 9 +++++---- .../ui/CreateHardwareWalletContent.kt | 3 +++ .../ui/CreateMobileWalletContent.kt | 3 +++ .../start/ui/ManualBackupStartContent.kt | 10 ++++++---- .../upgradewallet/ui/UpgradeWalletContent.kt | 3 +++ .../ui/WalletHardwareBackupContent.kt | 2 ++ 9 files changed, 41 insertions(+), 13 deletions(-) diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/Dialogs.kt b/core/ui/src/main/java/com/tangem/core/ui/components/Dialogs.kt index f9baae94a7..faeb20ff2f 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/Dialogs.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/Dialogs.kt @@ -308,13 +308,14 @@ private fun DialogContent(type: DialogType, modifier: Modifier = Modifier) { } } +@OptIn(ExperimentalLayoutApi::class) @Composable private fun DialogButtons( confirmButton: DialogButtonUM, dismissButton: DialogButtonUM?, modifier: Modifier = Modifier, ) { - Row( + FlowRow( modifier = modifier, horizontalArrangement = Arrangement.spacedBy( space = TangemTheme.dimens.spacing4, diff --git a/features/create-wallet-selection/impl/src/main/kotlin/com/tangem/features/createwalletselection/ui/CreateWalletSelectionContent.kt b/features/create-wallet-selection/impl/src/main/kotlin/com/tangem/features/createwalletselection/ui/CreateWalletSelectionContent.kt index 07cdb0689e..cddcad417a 100644 --- a/features/create-wallet-selection/impl/src/main/kotlin/com/tangem/features/createwalletselection/ui/CreateWalletSelectionContent.kt +++ b/features/create-wallet-selection/impl/src/main/kotlin/com/tangem/features/createwalletselection/ui/CreateWalletSelectionContent.kt @@ -6,6 +6,8 @@ import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -23,6 +25,7 @@ import com.tangem.core.ui.components.label.entity.LabelStyle import com.tangem.core.ui.components.label.entity.LabelUM import com.tangem.core.ui.extensions.resolveReference import com.tangem.core.ui.extensions.resourceReference +import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.extensions.stringResourceSafe import com.tangem.core.ui.res.TangemTheme import com.tangem.core.ui.res.TangemThemePreview @@ -72,6 +75,7 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi Column( modifier = Modifier .weight(1f) + .verticalScroll(rememberScrollState()) .padding( start = 16.dp, top = 24.dp, @@ -114,6 +118,7 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi } } +@OptIn(ExperimentalLayoutApi::class) @Composable private fun WalletBlock( title: String, @@ -138,12 +143,11 @@ private fun WalletBlock( vertical = 12.dp, ), ) { - Row( + FlowRow( horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalArrangement = Arrangement.spacedBy(4.dp), ) { Text( - modifier = Modifier - .weight(1f, fill = false), text = title, style = TangemTheme.typography.subtitle1, color = TangemTheme.colors.text.primary1, @@ -178,6 +182,7 @@ private fun WalletBlock( private fun Feature(feature: CreateWalletSelectionUM.Feature, modifier: Modifier = Modifier) { Row( modifier = modifier, + verticalAlignment = Alignment.CenterVertically, ) { Icon( modifier = Modifier.size(TangemTheme.dimens.size16), @@ -223,6 +228,8 @@ private fun AlreadyHaveTangemWalletBlock( text = stringResourceSafe(R.string.wallet_add_hardware_purchase), style = TangemTheme.typography.button, color = TangemTheme.colors.text.primary1, + maxLines = 3, + overflow = TextOverflow.Ellipsis, ) SecondaryButton( @@ -244,7 +251,7 @@ private fun PreviewCreateWalletContent() { onBackClick = { }, blocks = persistentListOf( CreateWalletSelectionUM.Block( - title = resourceReference(R.string.wallet_create_hardware_title), + title = stringReference("Hardware wallet very long title"), titleLabel = LabelUM( text = resourceReference(R.string.common_recommended), style = LabelStyle.ACCENT, @@ -279,6 +286,7 @@ private fun PreviewCreateWalletContent() { onClick = { }, ), ), + shouldShowAlreadyHaveWallet = true, onBuyClick = { }, ), ) diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/accesscode/AccessCodeModel.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/accesscode/AccessCodeModel.kt index 595dff3477..0e1efd5301 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/accesscode/AccessCodeModel.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/accesscode/AccessCodeModel.kt @@ -154,6 +154,11 @@ internal class AccessCodeModel @Inject constructor( title = resourceReference(R.string.access_code_alert_validation_ok), onClick = ::setNewCode, ), + onDismissRequest = { + uiState.update { currentState -> + currentState.copy(onAccessCodeChange = ::onAccessCodeChange) + } + }, ), ) } diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/common/ui/OptionBlock.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/common/ui/OptionBlock.kt index 6f7f584bfb..bcc2a2c440 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/common/ui/OptionBlock.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/common/ui/OptionBlock.kt @@ -3,7 +3,8 @@ package com.tangem.features.hotwallet.common.ui import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material3.Text @@ -19,6 +20,7 @@ import com.tangem.core.ui.res.TangemTheme private const val DISABLED_COLORS_ALPHA = 0.5f +@OptIn(ExperimentalLayoutApi::class) @Suppress("LongParameterList") @Composable internal fun OptionBlock( @@ -44,12 +46,11 @@ internal fun OptionBlock( } .padding(16.dp), ) { - Row( + FlowRow( horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalArrangement = Arrangement.spacedBy(4.dp), ) { Text( - modifier = Modifier - .weight(1f, fill = false), text = title, style = TangemTheme.typography.subtitle1, color = TangemTheme.colors.text.primary1, diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/createhardwarewallet/ui/CreateHardwareWalletContent.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/createhardwarewallet/ui/CreateHardwareWalletContent.kt index 8f2ce41cfd..095790c30a 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/createhardwarewallet/ui/CreateHardwareWalletContent.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/createhardwarewallet/ui/CreateHardwareWalletContent.kt @@ -3,6 +3,8 @@ package com.tangem.features.hotwallet.createhardwarewallet.ui import android.content.res.Configuration import androidx.compose.foundation.background import androidx.compose.foundation.layout.* +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -42,6 +44,7 @@ internal fun CreateHardwareWalletContent(state: CreateHardwareWalletUM, modifier Column( modifier = Modifier .weight(1f) + .verticalScroll(rememberScrollState()) .padding( start = 16.dp, top = 24.dp, diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/createmobilewallet/ui/CreateMobileWalletContent.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/createmobilewallet/ui/CreateMobileWalletContent.kt index 99f127b9bf..e6916bdcfd 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/createmobilewallet/ui/CreateMobileWalletContent.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/createmobilewallet/ui/CreateMobileWalletContent.kt @@ -3,6 +3,8 @@ package com.tangem.features.hotwallet.createmobilewallet.ui import android.content.res.Configuration import androidx.compose.foundation.background import androidx.compose.foundation.layout.* +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -41,6 +43,7 @@ internal fun CreateMobileWalletContent(state: CreateMobileWalletUM, modifier: Mo Column( modifier = Modifier .weight(1f) + .verticalScroll(rememberScrollState()) .padding( start = 16.dp, top = 24.dp, diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/manualbackup/start/ui/ManualBackupStartContent.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/manualbackup/start/ui/ManualBackupStartContent.kt index fe37f62480..8d2a207aa8 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/manualbackup/start/ui/ManualBackupStartContent.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/manualbackup/start/ui/ManualBackupStartContent.kt @@ -8,7 +8,6 @@ import androidx.compose.foundation.verticalScroll import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview @@ -25,7 +24,7 @@ import com.tangem.features.hotwallet.manualbackup.start.entity.ManualBackupStart @OptIn(ExperimentalMaterial3Api::class) @Composable internal fun ManualBackupStartContent(state: ManualBackupStartUM, modifier: Modifier = Modifier) { - Box( + Column( modifier .background(TangemTheme.colors.background.primary) .fillMaxSize() @@ -36,7 +35,11 @@ internal fun ManualBackupStartContent(state: ManualBackupStartUM, modifier: Modi bottom = 16.dp, ), ) { - Column(modifier = Modifier.verticalScroll(rememberScrollState())) { + Column( + modifier = Modifier + .weight(1f) + .verticalScroll(rememberScrollState()), + ) { Text( modifier = Modifier .fillMaxWidth() @@ -86,7 +89,6 @@ internal fun ManualBackupStartContent(state: ManualBackupStartUM, modifier: Modi PrimaryButton( modifier = Modifier - .align(Alignment.BottomCenter) .fillMaxWidth() .padding(top = 16.dp), text = stringResourceSafe(R.string.common_continue), diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/upgradewallet/ui/UpgradeWalletContent.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/upgradewallet/ui/UpgradeWalletContent.kt index 515d01c482..a643ee75e0 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/upgradewallet/ui/UpgradeWalletContent.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/upgradewallet/ui/UpgradeWalletContent.kt @@ -3,6 +3,8 @@ package com.tangem.features.hotwallet.upgradewallet.ui import android.content.res.Configuration import androidx.compose.foundation.background import androidx.compose.foundation.layout.* +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.Text @@ -44,6 +46,7 @@ internal fun UpgradeWalletContent(state: UpgradeWalletUM, modifier: Modifier = M Column( modifier = Modifier .weight(1f) + .verticalScroll(rememberScrollState()) .padding( start = 16.dp, top = 24.dp, diff --git a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/wallethardwarebackup/ui/WalletHardwareBackupContent.kt b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/wallethardwarebackup/ui/WalletHardwareBackupContent.kt index 9635f67b45..8e4eafbf78 100644 --- a/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/wallethardwarebackup/ui/WalletHardwareBackupContent.kt +++ b/features/hot-wallet/impl/src/main/kotlin/com/tangem/features/hotwallet/wallethardwarebackup/ui/WalletHardwareBackupContent.kt @@ -117,6 +117,8 @@ private fun PurchaseBlock(onBuyClick: () -> Unit, modifier: Modifier = Modifier) text = stringResourceSafe(R.string.wallet_add_hardware_purchase), style = TangemTheme.typography.button, color = TangemTheme.colors.text.primary1, + maxLines = 3, + overflow = TextOverflow.Ellipsis, ) SecondaryButton(