Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-24 15:09:31 +03:00
parent 910be11531
commit 1dc34173a8
8 changed files with 75 additions and 58 deletions

View file

@ -14,6 +14,7 @@ android {
dependencies {
/** Api */
implementation(projects.features.createWalletStart.api)
implementation(projects.features.hotWallet.api)
/** Project - Domain */
implementation(projects.domain.card)

View file

@ -32,6 +32,7 @@ import com.tangem.domain.wallets.builder.ColdUserWalletBuilder
import com.tangem.domain.wallets.usecase.GenerateBuyTangemCardLinkUseCase
import com.tangem.domain.wallets.usecase.SaveWalletUseCase
import com.tangem.features.createwalletstart.entity.CreateWalletStartUM
import com.tangem.features.hotwallet.HotWalletFeatureToggles
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.delay
@ -63,6 +64,7 @@ internal class CreateWalletStartModel @Inject constructor(
private val urlOpener: UrlOpener,
private val trackingContextProxy: TrackingContextProxy,
private val analyticsEventHandler: AnalyticsEventHandler,
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
) : Model() {
private val params = paramsContainer.require<CreateWalletStartComponent.Params>()
@ -97,6 +99,7 @@ internal class CreateWalletStartModel @Inject constructor(
onBackClick = { router.pop() },
onScanClick = ::onScanClick,
isScanInProgress = false,
isHotWalletOptionVisible = hotWalletFeatureToggles.isHotWalletVisible,
)
CreateWalletStartComponent.Mode.HotWallet -> CreateWalletStartUM(
title = resourceReference(R.string.hw_mobile_wallet),

View file

@ -17,6 +17,7 @@ internal data class CreateWalletStartUM(
val otherMethodClick: () -> Unit,
val onScanClick: () -> Unit,
val onBackClick: () -> Unit,
val isHotWalletOptionVisible: Boolean = true,
) {
data class FeatureItem(
val iconResId: Int,

View file

@ -165,70 +165,74 @@ internal fun CreateWalletStartContent(state: CreateWalletStartUM, modifier: Modi
text = state.primaryButtonText.resolveReference(),
onClick = state.onPrimaryButtonClick,
)
Row(
modifier = Modifier
.padding(
start = 16.dp,
top = 24.dp,
end = 16.dp,
),
horizontalArrangement = Arrangement.spacedBy(16.dp),
verticalAlignment = Alignment.CenterVertically,
) {
DashedGradientLine(
if (state.isHotWalletOptionVisible) {
Row(
modifier = Modifier
.weight(1f)
.height(16.dp),
)
Text(
text = stringResourceSafe(R.string.common_or),
style = TangemTheme.typography.caption1,
color = TangemTheme.colors.text.secondary,
textAlign = TextAlign.Center,
)
DashedGradientLine(
modifier = Modifier
.weight(1f)
.height(16.dp)
.scale(scaleX = -1f, scaleY = 1f),
)
}
if (state.otherMethodDescription != null) {
Text(
modifier = Modifier
.fillMaxWidth()
.padding(
start = 16.dp,
top = 16.dp,
top = 24.dp,
end = 16.dp,
),
text = state.otherMethodDescription.resolveReference(),
style = TangemTheme.typography.subtitle2,
color = TangemTheme.colors.text.tertiary,
textAlign = TextAlign.Center,
)
horizontalArrangement = Arrangement.spacedBy(16.dp),
verticalAlignment = Alignment.CenterVertically,
) {
DashedGradientLine(
modifier = Modifier
.weight(1f)
.height(16.dp),
)
Text(
text = stringResourceSafe(R.string.common_or),
style = TangemTheme.typography.caption1,
color = TangemTheme.colors.text.secondary,
textAlign = TextAlign.Center,
)
DashedGradientLine(
modifier = Modifier
.weight(1f)
.height(16.dp)
.scale(scaleX = -1f, scaleY = 1f),
)
}
}
Row(
modifier = Modifier
.wrapContentWidth()
.clickable { state.otherMethodClick() }
.padding(
horizontal = 16.dp,
vertical = 12.dp,
),
horizontalArrangement = Arrangement.Center,
) {
Text(
text = state.otherMethodTitle.resolveReference(),
style = TangemTheme.typography.subtitle1,
color = TangemTheme.colors.text.primary1,
textAlign = TextAlign.Center,
)
Icon(
painter = painterResource(id = R.drawable.ic_chevron_right_18x24),
tint = TangemTheme.colors.icon.primary1,
contentDescription = null,
)
if (state.isHotWalletOptionVisible) {
if (state.otherMethodDescription != null) {
Text(
modifier = Modifier
.fillMaxWidth()
.padding(
start = 16.dp,
top = 16.dp,
end = 16.dp,
),
text = state.otherMethodDescription.resolveReference(),
style = TangemTheme.typography.subtitle2,
color = TangemTheme.colors.text.tertiary,
textAlign = TextAlign.Center,
)
}
Row(
modifier = Modifier
.wrapContentWidth()
.clickable { state.otherMethodClick() }
.padding(
horizontal = 16.dp,
vertical = 12.dp,
),
horizontalArrangement = Arrangement.Center,
) {
Text(
text = state.otherMethodTitle.resolveReference(),
style = TangemTheme.typography.subtitle1,
color = TangemTheme.colors.text.primary1,
textAlign = TextAlign.Center,
)
Icon(
painter = painterResource(id = R.drawable.ic_chevron_right_18x24),
tint = TangemTheme.colors.icon.primary1,
contentDescription = null,
)
}
}
},
minImageHeight = 160.dp,

View file

@ -23,6 +23,7 @@ internal class PreviewDetailsComponent : DetailsComponent {
hotWalletFeatureToggles = object : HotWalletFeatureToggles {
override val isHotWalletEnabled: Boolean = true
override val isWalletCreationRestrictionEnabled: Boolean = true
override val isHotWalletVisible: Boolean = true
},
).buildAll(
isWalletConnectAvailable = true,

View file

@ -3,4 +3,5 @@ package com.tangem.features.hotwallet
interface HotWalletFeatureToggles {
val isHotWalletEnabled: Boolean
val isWalletCreationRestrictionEnabled: Boolean
val isHotWalletVisible: Boolean
}

View file

@ -10,4 +10,6 @@ internal class DefaultHotWalletFeatureToggles(
override val isWalletCreationRestrictionEnabled: Boolean
get() = isHotWalletEnabled &&
featureTogglesManager.isFeatureEnabled(name = "HOT_WALLET_CREATION_RESTRICTION_ENABLED")
override val isHotWalletVisible: Boolean
get() = featureTogglesManager.isFeatureEnabled(name = "HOT_WALLET_VISIBLE")
}