Updated on 2026-08-14
This commit is contained in:
parent
1cecd561dc
commit
64626bbcbc
8 changed files with 274 additions and 11 deletions
43
core/ui/src/main/res/drawable/ic_create_mobile_wallet_56.xml
Normal file
43
core/ui/src/main/res/drawable/ic_create_mobile_wallet_56.xml
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="56dp"
|
||||||
|
android:height="56dp"
|
||||||
|
android:viewportWidth="56"
|
||||||
|
android:viewportHeight="56">
|
||||||
|
<path
|
||||||
|
android:pathData="M13.552,27.579C13.552,29.404 15.031,30.884 16.857,30.884C18.682,30.884 20.162,29.404 20.162,27.579C20.162,25.753 18.682,24.273 16.857,24.273C15.031,24.273 13.552,25.753 13.552,27.579Z"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#919191"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M33.83,13.256H20.609C14.376,13.256 11.26,13.256 9.324,15.192C7.387,17.128 7.387,20.245 7.387,26.477V30.884C7.387,37.117 7.387,40.233 9.324,42.169C11.26,44.106 14.376,44.106 20.609,44.106H28.324"
|
||||||
|
android:strokeAlpha="0.2"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#919191"
|
||||||
|
android:fillAlpha="0.2"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M28.765,44.105H22.816C16.336,44.105 13.096,44.105 10.839,42.434C10.162,41.933 9.563,41.334 9.062,40.658C7.391,38.4 7.391,35.16 7.391,28.681V28.681C7.391,22.201 7.391,18.962 9.062,16.704C9.563,16.027 10.162,15.429 10.839,14.927C13.096,13.256 16.336,13.256 22.816,13.256H42.427C46.687,13.256 50.14,16.709 50.14,20.968V20.968V24.824"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#919191"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M12.332,13.544C12.332,12.714 12.332,13.403 12.373,13.054C12.697,10.308 14.863,8.142 17.609,7.818C17.958,7.777 18.373,7.777 19.202,7.777H38.326C39.155,7.777 39.57,7.777 39.919,7.818C42.665,8.142 44.831,10.308 45.155,13.054C45.196,13.403 45.196,12.714 45.196,13.544"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#919191"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M39.405,28.682L45.433,28.682A3.725,3.725 0,0 1,49.159 32.407L49.159,44.82A3.725,3.725 0,0 1,45.433 48.545L39.405,48.545A3.725,3.725 0,0 1,35.68 44.82L35.68,32.407A3.725,3.725 0,0 1,39.405 28.682z"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#919191"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M41.213,32.486H43.627"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="#919191"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
</vector>
|
||||||
|
|
@ -6,6 +6,7 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import com.tangem.core.decompose.context.AppComponentContext
|
import com.tangem.core.decompose.context.AppComponentContext
|
||||||
import com.tangem.core.decompose.model.getOrCreateModel
|
import com.tangem.core.decompose.model.getOrCreateModel
|
||||||
|
import com.tangem.features.createwalletselection.ui.CreateWalletSelectionContent
|
||||||
import dagger.assisted.Assisted
|
import dagger.assisted.Assisted
|
||||||
import dagger.assisted.AssistedFactory
|
import dagger.assisted.AssistedFactory
|
||||||
import dagger.assisted.AssistedInject
|
import dagger.assisted.AssistedInject
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.tangem.features.createwalletselection
|
package com.tangem.features.createwalletselection.ui
|
||||||
|
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
|
@ -52,7 +52,7 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
text = "What to choose?",
|
text = "What to choose?",
|
||||||
style = TangemTheme.typography.body1,
|
style = TangemTheme.typography.body1,
|
||||||
color = TangemTheme.colors.text.primary1,
|
color = TangemTheme.colors.text.primary1,
|
||||||
|
|
@ -74,7 +74,7 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
text = "Choose how you want to create your wallet",
|
text = "Choose how you want to create your wallet",
|
||||||
style = TangemTheme.typography.h2,
|
style = TangemTheme.typography.h2,
|
||||||
color = TangemTheme.colors.text.primary1,
|
color = TangemTheme.colors.text.primary1,
|
||||||
|
|
@ -83,9 +83,9 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi
|
||||||
WalletBlock(
|
WalletBlock(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(top = 24.dp),
|
.padding(top = 24.dp),
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
title = "Mobile Wallet",
|
title = "Mobile Wallet",
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
description = "A secure wallet is created on your phone in seconds.",
|
description = "A secure wallet is created on your phone in seconds.",
|
||||||
badge = {
|
badge = {
|
||||||
Box(
|
Box(
|
||||||
|
|
@ -97,7 +97,7 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi
|
||||||
.padding(horizontal = 8.dp, vertical = 4.dp),
|
.padding(horizontal = 8.dp, vertical = 4.dp),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
text = "Free",
|
text = "Free",
|
||||||
style = TangemTheme.typography.caption1,
|
style = TangemTheme.typography.caption1,
|
||||||
color = TangemTheme.colors.text.secondary,
|
color = TangemTheme.colors.text.secondary,
|
||||||
|
|
@ -107,9 +107,9 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi
|
||||||
onClick = state.onMobileWalletClick,
|
onClick = state.onMobileWalletClick,
|
||||||
)
|
)
|
||||||
WalletBlock(
|
WalletBlock(
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
title = "Hardware Wallet",
|
title = "Hardware Wallet",
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
description = "Buy Tangem Wallet — physical cards that securely store your crypto offline.",
|
description = "Buy Tangem Wallet — physical cards that securely store your crypto offline.",
|
||||||
badge = {
|
badge = {
|
||||||
Box(
|
Box(
|
||||||
|
|
@ -121,7 +121,7 @@ internal fun CreateWalletSelectionContent(state: CreateWalletSelectionUM, modifi
|
||||||
.padding(horizontal = 8.dp, vertical = 4.dp),
|
.padding(horizontal = 8.dp, vertical = 4.dp),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
text = "From $54.90",
|
text = "From $54.90",
|
||||||
style = TangemTheme.typography.caption1,
|
style = TangemTheme.typography.caption1,
|
||||||
color = TangemTheme.colors.text.accent,
|
color = TangemTheme.colors.text.accent,
|
||||||
|
|
@ -201,7 +201,7 @@ private fun AlreadyHaveTangemWalletBlock(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(end = 16.dp),
|
.padding(end = 16.dp),
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
text = "Do you already have Tangem Wallet?",
|
text = "Do you already have Tangem Wallet?",
|
||||||
style = TangemTheme.typography.button,
|
style = TangemTheme.typography.button,
|
||||||
color = TangemTheme.colors.text.primary1,
|
color = TangemTheme.colors.text.primary1,
|
||||||
|
|
@ -209,7 +209,7 @@ private fun AlreadyHaveTangemWalletBlock(
|
||||||
TangemButton(
|
TangemButton(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.wrapContentWidth(),
|
.wrapContentWidth(),
|
||||||
// TODO update and extract this string
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
text = "Scan Now",
|
text = "Scan Now",
|
||||||
onClick = onScanClick,
|
onClick = onScanClick,
|
||||||
icon = TangemButtonIconPosition.End(iconResId = R.drawable.ic_tangem_24),
|
icon = TangemButtonIconPosition.End(iconResId = R.drawable.ic_tangem_24),
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.tangem.features.hotwallet
|
||||||
|
|
||||||
|
import com.tangem.core.decompose.factory.ComponentFactory
|
||||||
|
import com.tangem.core.ui.decompose.ComposableContentComponent
|
||||||
|
|
||||||
|
interface CreateMobileWalletComponent : ComposableContentComponent {
|
||||||
|
interface Factory : ComponentFactory<Unit, CreateMobileWalletComponent>
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.tangem.features.hotwallet.createmobilewallet
|
||||||
|
|
||||||
|
import com.tangem.core.decompose.di.ModelScoped
|
||||||
|
import com.tangem.core.decompose.model.Model
|
||||||
|
import com.tangem.features.hotwallet.createmobilewallet.entity.CreateMobileWalletUM
|
||||||
|
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||||
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
|
import kotlinx.coroutines.flow.StateFlow
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ModelScoped
|
||||||
|
internal class CreateMobileWalletModel @Inject constructor(
|
||||||
|
override val dispatchers: CoroutineDispatcherProvider,
|
||||||
|
) : Model() {
|
||||||
|
|
||||||
|
internal val uiState: StateFlow<CreateMobileWalletUM>
|
||||||
|
field = MutableStateFlow(
|
||||||
|
CreateMobileWalletUM(
|
||||||
|
onBackClick = { /* [REDACTED_TODO_COMMENT] */ },
|
||||||
|
onCreateClick = ::onCreateClick,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
private fun onCreateClick() {
|
||||||
|
// TODO create a wallet
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.tangem.features.hotwallet.createmobilewallet
|
||||||
|
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
|
import com.tangem.core.decompose.context.AppComponentContext
|
||||||
|
import com.tangem.core.decompose.model.getOrCreateModel
|
||||||
|
import com.tangem.features.hotwallet.CreateMobileWalletComponent
|
||||||
|
import com.tangem.features.hotwallet.createmobilewallet.ui.CreateMobileWalletContent
|
||||||
|
import dagger.assisted.Assisted
|
||||||
|
import dagger.assisted.AssistedFactory
|
||||||
|
import dagger.assisted.AssistedInject
|
||||||
|
|
||||||
|
internal class DefaultCreateMobileWalletComponent @AssistedInject constructor(
|
||||||
|
@Assisted private val context: AppComponentContext,
|
||||||
|
@Assisted private val params: Unit,
|
||||||
|
) : CreateMobileWalletComponent, AppComponentContext by context {
|
||||||
|
private val model: CreateMobileWalletModel = getOrCreateModel(params)
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
override fun Content(modifier: Modifier) {
|
||||||
|
val state by model.uiState.collectAsStateWithLifecycle()
|
||||||
|
CreateMobileWalletContent(
|
||||||
|
state = state,
|
||||||
|
modifier = modifier,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@AssistedFactory
|
||||||
|
interface Factory : CreateMobileWalletComponent.Factory {
|
||||||
|
override fun create(context: AppComponentContext, params: Unit): DefaultCreateMobileWalletComponent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.tangem.features.hotwallet.createmobilewallet.entity
|
||||||
|
|
||||||
|
internal data class CreateMobileWalletUM(
|
||||||
|
val onBackClick: () -> Unit,
|
||||||
|
val onCreateClick: () -> Unit,
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,144 @@
|
||||||
|
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.material3.*
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.tangem.core.ui.R
|
||||||
|
import com.tangem.core.ui.components.PrimaryButton
|
||||||
|
import com.tangem.core.ui.components.appbar.TangemTopAppBar
|
||||||
|
import com.tangem.core.ui.components.appbar.models.TopAppBarButtonUM
|
||||||
|
import com.tangem.core.ui.extensions.TextReference
|
||||||
|
import com.tangem.core.ui.res.TangemTheme
|
||||||
|
import com.tangem.core.ui.res.TangemThemePreview
|
||||||
|
import com.tangem.features.hotwallet.createmobilewallet.entity.CreateMobileWalletUM
|
||||||
|
|
||||||
|
@Suppress("LongMethod")
|
||||||
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
@Composable
|
||||||
|
internal fun CreateMobileWalletContent(state: CreateMobileWalletUM, modifier: Modifier = Modifier) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.background(TangemTheme.colors.background.primary)
|
||||||
|
.fillMaxSize()
|
||||||
|
.systemBarsPadding(),
|
||||||
|
) {
|
||||||
|
TangemTopAppBar(
|
||||||
|
modifier = modifier
|
||||||
|
.statusBarsPadding(),
|
||||||
|
startButton = TopAppBarButtonUM.Back(state.onBackClick),
|
||||||
|
title = TextReference.EMPTY,
|
||||||
|
)
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.weight(1f)
|
||||||
|
.padding(
|
||||||
|
start = 16.dp,
|
||||||
|
top = 24.dp,
|
||||||
|
end = 16.dp,
|
||||||
|
),
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth(),
|
||||||
|
painter = painterResource(R.drawable.ic_create_mobile_wallet_56),
|
||||||
|
contentDescription = null,
|
||||||
|
tint = TangemTheme.colors.icon.informative,
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(
|
||||||
|
start = 16.dp,
|
||||||
|
top = 20.dp,
|
||||||
|
end = 16.dp,
|
||||||
|
),
|
||||||
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
|
text = "Create Mobile Wallet",
|
||||||
|
style = TangemTheme.typography.h2,
|
||||||
|
color = TangemTheme.colors.text.primary1,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
)
|
||||||
|
FeatureBlock(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(top = 32.dp),
|
||||||
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
|
title = "Keys are stored in the app",
|
||||||
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
|
description = "Get notified of incoming transactions",
|
||||||
|
iconRes = R.drawable.ic_lock_24,
|
||||||
|
)
|
||||||
|
FeatureBlock(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(top = 24.dp),
|
||||||
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
|
title = "Seed phrase backup",
|
||||||
|
// TODO [REDACTED_TASK_KEY] update and extract this string
|
||||||
|
description = "Stay up to date with the latest features and news",
|
||||||
|
iconRes = R.drawable.ic_settings_24,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
PrimaryButton(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(16.dp),
|
||||||
|
text = "Create",
|
||||||
|
showProgress = false,
|
||||||
|
enabled = true,
|
||||||
|
onClick = state.onCreateClick,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun FeatureBlock(title: String, description: String, iconRes: Int, modifier: Modifier = Modifier) {
|
||||||
|
Row(
|
||||||
|
modifier = modifier,
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(horizontal = 12.dp),
|
||||||
|
painter = painterResource(iconRes),
|
||||||
|
contentDescription = null,
|
||||||
|
tint = TangemTheme.colors.icon.primary1,
|
||||||
|
)
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 8.dp),
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = title,
|
||||||
|
style = TangemTheme.typography.subtitle1,
|
||||||
|
color = TangemTheme.colors.text.primary1,
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(top = 4.dp),
|
||||||
|
text = description,
|
||||||
|
style = TangemTheme.typography.body2,
|
||||||
|
color = TangemTheme.colors.text.secondary,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Preview(showBackground = true, widthDp = 360)
|
||||||
|
@Preview(showBackground = true, widthDp = 360, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||||
|
@Composable
|
||||||
|
private fun PreviewCreateWalletContent() {
|
||||||
|
TangemThemePreview {
|
||||||
|
CreateMobileWalletContent(
|
||||||
|
state = CreateMobileWalletUM(
|
||||||
|
onBackClick = {},
|
||||||
|
onCreateClick = {},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue