Updated on 2026-08-14
This commit is contained in:
parent
910be11531
commit
1dc34173a8
8 changed files with 75 additions and 58 deletions
|
|
@ -39,6 +39,10 @@
|
||||||
"name": "HOT_WALLET_CREATION_RESTRICTION_ENABLED",
|
"name": "HOT_WALLET_CREATION_RESTRICTION_ENABLED",
|
||||||
"version": "5.32.0"
|
"version": "5.32.0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "HOT_WALLET_VISIBLE",
|
||||||
|
"version": "undefined"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "TANGEM_PAY_ENABLED",
|
"name": "TANGEM_PAY_ENABLED",
|
||||||
"version": "5.31.0"
|
"version": "5.31.0"
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
/** Api */
|
/** Api */
|
||||||
implementation(projects.features.createWalletStart.api)
|
implementation(projects.features.createWalletStart.api)
|
||||||
|
implementation(projects.features.hotWallet.api)
|
||||||
|
|
||||||
/** Project - Domain */
|
/** Project - Domain */
|
||||||
implementation(projects.domain.card)
|
implementation(projects.domain.card)
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import com.tangem.domain.wallets.builder.ColdUserWalletBuilder
|
||||||
import com.tangem.domain.wallets.usecase.GenerateBuyTangemCardLinkUseCase
|
import com.tangem.domain.wallets.usecase.GenerateBuyTangemCardLinkUseCase
|
||||||
import com.tangem.domain.wallets.usecase.SaveWalletUseCase
|
import com.tangem.domain.wallets.usecase.SaveWalletUseCase
|
||||||
import com.tangem.features.createwalletstart.entity.CreateWalletStartUM
|
import com.tangem.features.createwalletstart.entity.CreateWalletStartUM
|
||||||
|
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
|
@ -63,6 +64,7 @@ internal class CreateWalletStartModel @Inject constructor(
|
||||||
private val urlOpener: UrlOpener,
|
private val urlOpener: UrlOpener,
|
||||||
private val trackingContextProxy: TrackingContextProxy,
|
private val trackingContextProxy: TrackingContextProxy,
|
||||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||||
|
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||||
) : Model() {
|
) : Model() {
|
||||||
|
|
||||||
private val params = paramsContainer.require<CreateWalletStartComponent.Params>()
|
private val params = paramsContainer.require<CreateWalletStartComponent.Params>()
|
||||||
|
|
@ -97,6 +99,7 @@ internal class CreateWalletStartModel @Inject constructor(
|
||||||
onBackClick = { router.pop() },
|
onBackClick = { router.pop() },
|
||||||
onScanClick = ::onScanClick,
|
onScanClick = ::onScanClick,
|
||||||
isScanInProgress = false,
|
isScanInProgress = false,
|
||||||
|
isHotWalletOptionVisible = hotWalletFeatureToggles.isHotWalletVisible,
|
||||||
)
|
)
|
||||||
CreateWalletStartComponent.Mode.HotWallet -> CreateWalletStartUM(
|
CreateWalletStartComponent.Mode.HotWallet -> CreateWalletStartUM(
|
||||||
title = resourceReference(R.string.hw_mobile_wallet),
|
title = resourceReference(R.string.hw_mobile_wallet),
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ internal data class CreateWalletStartUM(
|
||||||
val otherMethodClick: () -> Unit,
|
val otherMethodClick: () -> Unit,
|
||||||
val onScanClick: () -> Unit,
|
val onScanClick: () -> Unit,
|
||||||
val onBackClick: () -> Unit,
|
val onBackClick: () -> Unit,
|
||||||
|
val isHotWalletOptionVisible: Boolean = true,
|
||||||
) {
|
) {
|
||||||
data class FeatureItem(
|
data class FeatureItem(
|
||||||
val iconResId: Int,
|
val iconResId: Int,
|
||||||
|
|
|
||||||
|
|
@ -165,70 +165,74 @@ internal fun CreateWalletStartContent(state: CreateWalletStartUM, modifier: Modi
|
||||||
text = state.primaryButtonText.resolveReference(),
|
text = state.primaryButtonText.resolveReference(),
|
||||||
onClick = state.onPrimaryButtonClick,
|
onClick = state.onPrimaryButtonClick,
|
||||||
)
|
)
|
||||||
Row(
|
if (state.isHotWalletOptionVisible) {
|
||||||
modifier = Modifier
|
Row(
|
||||||
.padding(
|
|
||||||
start = 16.dp,
|
|
||||||
top = 24.dp,
|
|
||||||
end = 16.dp,
|
|
||||||
),
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
) {
|
|
||||||
DashedGradientLine(
|
|
||||||
modifier = Modifier
|
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(
|
.padding(
|
||||||
start = 16.dp,
|
start = 16.dp,
|
||||||
top = 16.dp,
|
top = 24.dp,
|
||||||
end = 16.dp,
|
end = 16.dp,
|
||||||
),
|
),
|
||||||
text = state.otherMethodDescription.resolveReference(),
|
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||||
style = TangemTheme.typography.subtitle2,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
color = TangemTheme.colors.text.tertiary,
|
) {
|
||||||
textAlign = TextAlign.Center,
|
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(
|
if (state.isHotWalletOptionVisible) {
|
||||||
modifier = Modifier
|
if (state.otherMethodDescription != null) {
|
||||||
.wrapContentWidth()
|
Text(
|
||||||
.clickable { state.otherMethodClick() }
|
modifier = Modifier
|
||||||
.padding(
|
.fillMaxWidth()
|
||||||
horizontal = 16.dp,
|
.padding(
|
||||||
vertical = 12.dp,
|
start = 16.dp,
|
||||||
),
|
top = 16.dp,
|
||||||
horizontalArrangement = Arrangement.Center,
|
end = 16.dp,
|
||||||
) {
|
),
|
||||||
Text(
|
text = state.otherMethodDescription.resolveReference(),
|
||||||
text = state.otherMethodTitle.resolveReference(),
|
style = TangemTheme.typography.subtitle2,
|
||||||
style = TangemTheme.typography.subtitle1,
|
color = TangemTheme.colors.text.tertiary,
|
||||||
color = TangemTheme.colors.text.primary1,
|
textAlign = TextAlign.Center,
|
||||||
textAlign = TextAlign.Center,
|
)
|
||||||
)
|
}
|
||||||
Icon(
|
Row(
|
||||||
painter = painterResource(id = R.drawable.ic_chevron_right_18x24),
|
modifier = Modifier
|
||||||
tint = TangemTheme.colors.icon.primary1,
|
.wrapContentWidth()
|
||||||
contentDescription = null,
|
.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,
|
minImageHeight = 160.dp,
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ internal class PreviewDetailsComponent : DetailsComponent {
|
||||||
hotWalletFeatureToggles = object : HotWalletFeatureToggles {
|
hotWalletFeatureToggles = object : HotWalletFeatureToggles {
|
||||||
override val isHotWalletEnabled: Boolean = true
|
override val isHotWalletEnabled: Boolean = true
|
||||||
override val isWalletCreationRestrictionEnabled: Boolean = true
|
override val isWalletCreationRestrictionEnabled: Boolean = true
|
||||||
|
override val isHotWalletVisible: Boolean = true
|
||||||
},
|
},
|
||||||
).buildAll(
|
).buildAll(
|
||||||
isWalletConnectAvailable = true,
|
isWalletConnectAvailable = true,
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,5 @@ package com.tangem.features.hotwallet
|
||||||
interface HotWalletFeatureToggles {
|
interface HotWalletFeatureToggles {
|
||||||
val isHotWalletEnabled: Boolean
|
val isHotWalletEnabled: Boolean
|
||||||
val isWalletCreationRestrictionEnabled: Boolean
|
val isWalletCreationRestrictionEnabled: Boolean
|
||||||
|
val isHotWalletVisible: Boolean
|
||||||
}
|
}
|
||||||
|
|
@ -10,4 +10,6 @@ internal class DefaultHotWalletFeatureToggles(
|
||||||
override val isWalletCreationRestrictionEnabled: Boolean
|
override val isWalletCreationRestrictionEnabled: Boolean
|
||||||
get() = isHotWalletEnabled &&
|
get() = isHotWalletEnabled &&
|
||||||
featureTogglesManager.isFeatureEnabled(name = "HOT_WALLET_CREATION_RESTRICTION_ENABLED")
|
featureTogglesManager.isFeatureEnabled(name = "HOT_WALLET_CREATION_RESTRICTION_ENABLED")
|
||||||
|
override val isHotWalletVisible: Boolean
|
||||||
|
get() = featureTogglesManager.isFeatureEnabled(name = "HOT_WALLET_VISIBLE")
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue