Updated on 2026-08-14
This commit is contained in:
parent
ac121ce008
commit
941baf081b
13 changed files with 237 additions and 11 deletions
|
|
@ -1414,6 +1414,14 @@
|
|||
<string name="visa_unlock_notification_button">Unlock</string>
|
||||
<string name="visa_unlock_notification_subtitle">Scan your card to unlock access</string>
|
||||
<string name="visa_unlock_notification_title">Needed unlock</string>
|
||||
<string name="tangempay_onboarding_title">Get your free Crypto Card\nin minutes</string>
|
||||
<string name="tangempay_onboarding_security_title">Built-in security</string>
|
||||
<string name="tangempay_onboarding_security_description">Your card details are protected — full control in the app.</string>
|
||||
<string name="tangempay_onboarding_purchases_title">Everyday purchases</string>
|
||||
<string name="tangempay_onboarding_purchases_description">Use your USDC balance to pay for everyday purchases seamlessly.</string>
|
||||
<string name="tangempay_onboarding_pay_title">Apple Pay & Google Pay</string>
|
||||
<string name="tangempay_onboarding_pay_description">Add to your wallet and pay with your phone anywhere.</string>
|
||||
<string name="tangempay_onboarding_get_card_button_text">Get card</string>
|
||||
<string name="wallet_balance_blockchain_unreachable_try_later">Blockchain is unreachable. Try later</string>
|
||||
<string name="wallet_balance_missing_derivation">Scan card or ring</string>
|
||||
<string name="wallet_been_activated_message">This wallet has already been activated earlier.\nIf it was not done by you, please contact support.\nTangem never sells wallets along with pre-generated access codes.</string>
|
||||
|
|
|
|||
16
core/ui/src/main/res/drawable/ic_credit_card_add_22.xml
Normal file
16
core/ui/src/main/res/drawable/ic_credit_card_add_22.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="18dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="18">
|
||||
<path
|
||||
android:pathData="M17.375,8.875C17.927,8.875 18.375,9.323 18.375,9.875V12.375H20.875C21.427,12.375 21.875,12.823 21.875,13.375C21.875,13.927 21.427,14.375 20.875,14.375H18.375V16.875C18.375,17.427 17.927,17.875 17.375,17.875C16.823,17.875 16.375,17.427 16.375,16.875L16.375,14.375H13.875C13.323,14.375 12.875,13.927 12.875,13.375C12.875,12.823 13.323,12.375 13.875,12.375H16.375L16.375,9.875C16.375,9.323 16.823,8.875 17.375,8.875Z"
|
||||
android:fillColor="#1E1E1E"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M16.844,0.254C15.706,0.125 14.262,0.125 12.423,0.125H9.327C7.488,0.125 6.044,0.125 4.906,0.254C3.743,0.385 2.801,0.659 2.018,1.277C1.783,1.462 1.566,1.667 1.368,1.889C0.702,2.636 0.404,3.542 0.263,4.653C0.246,4.781 0.238,4.845 0.253,4.901C0.276,4.991 0.345,5.069 0.431,5.103C0.485,5.125 0.552,5.125 0.687,5.125H21.063C21.198,5.125 21.265,5.125 21.319,5.103C21.405,5.069 21.474,4.991 21.497,4.901C21.512,4.845 21.504,4.781 21.487,4.653C21.346,3.542 21.048,2.636 20.382,1.889C20.184,1.667 19.967,1.462 19.732,1.277C18.949,0.659 18.007,0.385 16.844,0.254Z"
|
||||
android:fillColor="#1E1E1E"/>
|
||||
<path
|
||||
android:pathData="M20.875,10.875C21.243,10.875 21.428,10.875 21.511,10.807C21.528,10.793 21.537,10.784 21.551,10.767C21.619,10.684 21.621,10.535 21.622,10.236C21.625,9.825 21.625,9.389 21.625,8.928V8.822C21.625,8.246 21.625,7.711 21.62,7.212C21.617,6.936 21.616,6.799 21.528,6.712C21.44,6.625 21.301,6.625 21.024,6.625H0.726C0.449,6.625 0.31,6.625 0.222,6.712C0.134,6.799 0.133,6.936 0.13,7.212C0.125,7.711 0.125,8.246 0.125,8.822V8.928C0.125,10.652 0.125,12.018 0.263,13.097C0.404,14.208 0.702,15.114 1.368,15.861C1.566,16.083 1.783,16.288 2.018,16.473C2.801,17.091 3.743,17.365 4.906,17.496C6.044,17.625 7.488,17.625 9.327,17.625H12.422C13.078,17.625 13.682,17.625 14.241,17.619C14.537,17.616 14.685,17.615 14.767,17.546C14.785,17.532 14.793,17.523 14.807,17.506C14.875,17.423 14.875,17.24 14.875,16.875V16.475C14.875,16.192 14.875,16.051 14.787,15.963C14.699,15.875 14.558,15.875 14.275,15.875H13.875C12.494,15.875 11.375,14.756 11.375,13.375C11.375,11.994 12.494,10.875 13.875,10.875H14.275C14.558,10.875 14.699,10.875 14.787,10.787C14.875,10.699 14.875,10.558 14.875,10.275V9.875C14.875,8.494 15.994,7.375 17.375,7.375C18.756,7.375 19.875,8.494 19.875,9.875V10.275C19.875,10.558 19.875,10.699 19.963,10.787C20.051,10.875 20.192,10.875 20.475,10.875H20.875Z"
|
||||
android:fillColor="#1E1E1E"/>
|
||||
</vector>
|
||||
9
core/ui/src/main/res/drawable/ic_security_check_22.xml
Normal file
9
core/ui/src/main/res/drawable/ic_security_check_22.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:pathData="M10.998,0.25C12.679,0.25 14.047,0.818 15.239,1.436C15.6,1.622 15.935,1.807 16.255,1.983C17.038,2.415 17.732,2.797 18.494,3.04C18.941,3.183 19.337,3.31 19.618,3.42C19.883,3.523 20.197,3.665 20.42,3.913C20.62,4.136 20.723,4.385 20.791,4.624C20.853,4.841 20.906,5.135 20.957,5.417C22.195,12.282 19.491,18.787 12.881,21.318C12.231,21.567 11.752,21.75 11.001,21.75C10.25,21.75 9.772,21.567 9.122,21.318C2.512,18.788 -0.195,12.283 1.043,5.417C1.094,5.135 1.146,4.841 1.208,4.624C1.276,4.385 1.38,4.136 1.58,3.913C1.803,3.666 2.117,3.523 2.381,3.42C2.662,3.31 3.059,3.183 3.506,3.04C4.267,2.797 4.961,2.415 5.743,1.983L6.235,1.713C6.404,1.621 6.578,1.529 6.758,1.436C7.95,0.818 9.317,0.25 10.998,0.25ZM16.941,7.666C16.757,7.146 16.185,6.873 15.665,7.058C14.787,7.369 13.948,7.961 13.211,8.607C12.464,9.262 11.766,10.023 11.173,10.734C10.734,11.261 10.344,11.769 10.029,12.199C9.741,11.854 9.453,11.601 9.179,11.418C8.904,11.235 8.551,11 7.999,11C7.447,11 6.999,11.448 6.999,12C6.999,12.521 7.397,12.949 7.905,12.996C8.109,13.015 8.664,13.566 9.104,14.447C9.266,14.77 9.588,14.981 9.948,14.999C10.308,15.017 10.649,14.84 10.843,14.536C10.848,14.529 11.192,14.013 11.356,13.78C11.688,13.311 12.156,12.677 12.708,12.016C13.262,11.352 13.887,10.675 14.529,10.111C15.182,9.539 15.799,9.132 16.333,8.943C16.854,8.759 17.126,8.187 16.941,7.666Z"
|
||||
android:fillColor="#1E1E1E"/>
|
||||
</vector>
|
||||
10
core/ui/src/main/res/drawable/ic_shopping_basket_22.xml
Normal file
10
core/ui/src/main/res/drawable/ic_shopping_basket_22.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:pathData="M12.24,1.567C15.292,1.567 17.795,3.916 18.041,6.905H19.244C19.721,6.905 20.157,6.905 20.505,6.956C20.888,7.012 21.296,7.146 21.6,7.517C21.9,7.884 21.957,8.309 21.946,8.696C21.935,9.053 21.862,9.491 21.781,9.977L20.597,17.038C20.41,18.153 20.258,19.055 20.05,19.761C19.834,20.493 19.534,21.101 18.993,21.57C18.449,22.041 17.809,22.245 17.062,22.34C16.347,22.432 15.454,22.432 14.356,22.432H9.643C8.546,22.432 7.652,22.432 6.938,22.34C6.191,22.245 5.551,22.041 5.007,21.57C4.466,21.101 4.165,20.494 3.949,19.761C3.74,19.055 3.59,18.153 3.403,17.038L2.219,9.977C2.137,9.491 2.064,9.053 2.054,8.696C2.043,8.31 2.099,7.884 2.399,7.517C2.703,7.146 3.112,7.012 3.495,6.956C3.843,6.905 4.278,6.905 4.756,6.905H6.439C6.686,3.916 9.188,1.567 12.24,1.567ZM12.24,3.508C10.261,3.508 8.628,4.99 8.39,6.905H16.091C15.852,4.99 14.22,3.508 12.24,3.508Z"
|
||||
android:fillColor="#1E1E1E"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
|
@ -18,9 +18,11 @@ dependencies {
|
|||
|
||||
/** Common */
|
||||
implementation(projects.common.routing)
|
||||
implementation(projects.common.ui)
|
||||
|
||||
/** Features api */
|
||||
implementation(projects.features.tangempay.onboarding.api)
|
||||
implementation(projects.features.kyc.api)
|
||||
|
||||
/** Compose */
|
||||
implementation(deps.compose.foundation)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import com.tangem.features.tangempay.components.TangemPayOnboardingComponent
|
|||
import com.tangem.features.tangempay.ui.TangemPayOnboardingScreenState
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import javax.inject.Inject
|
||||
|
||||
@Stable
|
||||
|
|
@ -21,8 +21,6 @@ internal class TangemPayOnboardingModel @Inject constructor(
|
|||
@Suppress("UnusedPrivateMember")
|
||||
private val params = paramsContainer.require<TangemPayOnboardingComponent.Params>()
|
||||
|
||||
private val _screenState: MutableStateFlow<TangemPayOnboardingScreenState> = MutableStateFlow(getInitState())
|
||||
val screenState = _screenState.asStateFlow()
|
||||
|
||||
private fun getInitState() = TangemPayOnboardingScreenState
|
||||
val screenState: StateFlow<TangemPayOnboardingScreenState>
|
||||
field = MutableStateFlow(TangemPayOnboardingScreenState())
|
||||
}
|
||||
|
|
@ -1,15 +1,17 @@
|
|||
package com.tangem.features.tangempay.ui
|
||||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.statusBarsPadding
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.appbar.AppBarWithBackButton
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
|
||||
@Suppress("UnusedPrivateMember")
|
||||
@Composable
|
||||
internal fun TandemPayOnboardingScreen(state: TangemPayOnboardingScreenState, modifier: Modifier = Modifier) {
|
||||
Scaffold(
|
||||
|
|
@ -18,14 +20,25 @@ internal fun TandemPayOnboardingScreen(state: TangemPayOnboardingScreenState, mo
|
|||
AppBarWithBackButton(
|
||||
modifier = Modifier.statusBarsPadding(),
|
||||
onBackClick = {},
|
||||
text = "",
|
||||
iconRes = R.drawable.ic_back_24,
|
||||
)
|
||||
},
|
||||
content = { paddingValues ->
|
||||
val contentModifier = Modifier
|
||||
.padding(paddingValues)
|
||||
.fillMaxSize()
|
||||
TangemPayOnboardingContent(
|
||||
modifier = Modifier
|
||||
.padding(paddingValues)
|
||||
.fillMaxSize(),
|
||||
state = state,
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Composable
|
||||
private fun PreviewDarkTheme() {
|
||||
TangemThemePreview {
|
||||
TandemPayOnboardingScreen(state = TangemPayOnboardingScreenState())
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.tangem.features.tangempay.ui
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
||||
@Composable
|
||||
internal fun TangemPayOnboardingBlock(
|
||||
@DrawableRes painterRes: Int,
|
||||
titleRef: TextReference,
|
||||
descriptionRef: TextReference,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Row(
|
||||
modifier = modifier
|
||||
.padding(start = 32.dp, end = 32.dp),
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = painterRes),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.width(24.dp)
|
||||
.height(24.dp),
|
||||
)
|
||||
Column(
|
||||
modifier = Modifier.padding(start = 12.dp),
|
||||
) {
|
||||
Text(
|
||||
text = titleRef.resolveReference(),
|
||||
style = TangemTheme.typography.subtitle1,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
)
|
||||
Text(
|
||||
text = descriptionRef.resolveReference(),
|
||||
style = TangemTheme.typography.body2,
|
||||
color = TangemTheme.colors.text.secondary,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.tangem.features.tangempay.ui
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.SpacerH
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
|
||||
@Composable
|
||||
internal fun TangemPayOnboardingBLocks(modifier: Modifier = Modifier) {
|
||||
TangemPayOnboardingBlock(
|
||||
modifier = modifier,
|
||||
painterRes = R.drawable.ic_security_check_22,
|
||||
titleRef = TextReference.Res(R.string.tangempay_onboarding_security_title),
|
||||
descriptionRef = TextReference.Res(R.string.tangempay_onboarding_security_description),
|
||||
)
|
||||
|
||||
SpacerH(18.dp)
|
||||
|
||||
TangemPayOnboardingBlock(
|
||||
modifier = modifier,
|
||||
painterRes = R.drawable.ic_shopping_basket_22,
|
||||
titleRef = TextReference.Res(R.string.tangempay_onboarding_purchases_title),
|
||||
descriptionRef = TextReference.Res(R.string.tangempay_onboarding_purchases_description),
|
||||
)
|
||||
|
||||
SpacerH(18.dp)
|
||||
|
||||
TangemPayOnboardingBlock(
|
||||
modifier = modifier,
|
||||
painterRes = R.drawable.ic_credit_card_add_22,
|
||||
titleRef = TextReference.Res(R.string.tangempay_onboarding_pay_title),
|
||||
descriptionRef = TextReference.Res(R.string.tangempay_onboarding_pay_description),
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.tangem.features.tangempay.ui
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.common.ui.navigationButtons.NavigationButton
|
||||
import com.tangem.common.ui.navigationButtons.NavigationPrimaryButton
|
||||
import com.tangem.core.ui.components.SpacerH
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.features.tangempay.onboarding.impl.R
|
||||
|
||||
@Composable
|
||||
internal fun TangemPayOnboardingContent(state: TangemPayOnboardingScreenState, modifier: Modifier = Modifier) {
|
||||
if (state.fullScreenLoading) {
|
||||
Box(
|
||||
modifier = modifier.fillMaxSize(),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier,
|
||||
color = TangemTheme.colors.icon.primary1,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
Column(
|
||||
modifier
|
||||
.fillMaxSize()
|
||||
.navigationBarsPadding(),
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(top = 24.dp, bottom = 32.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.img_tangem_pay_onboarding),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.height(250.dp)
|
||||
.fillMaxWidth(),
|
||||
)
|
||||
|
||||
Text(
|
||||
text = stringResourceSafe(R.string.tangempay_onboarding_title),
|
||||
style = TangemTheme.typography.h2,
|
||||
color = TangemTheme.colors.text.primary1,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
|
||||
SpacerH(32.dp)
|
||||
|
||||
TangemPayOnboardingBLocks()
|
||||
}
|
||||
|
||||
NavigationPrimaryButton(
|
||||
modifier = Modifier
|
||||
.imePadding()
|
||||
.padding(start = 16.dp, end = 16.dp, bottom = 16.dp)
|
||||
.fillMaxWidth(),
|
||||
primaryButton = NavigationButton(
|
||||
textReference = resourceReference(R.string.tangempay_onboarding_get_card_button_text),
|
||||
iconRes = R.drawable.ic_tangem_24,
|
||||
isIconVisible = true,
|
||||
showProgress = state.buttonLoading,
|
||||
onClick = {},
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,9 @@
|
|||
package com.tangem.features.tangempay.ui
|
||||
|
||||
internal object TangemPayOnboardingScreenState
|
||||
import javax.annotation.concurrent.Immutable
|
||||
|
||||
@Immutable
|
||||
internal data class TangemPayOnboardingScreenState(
|
||||
val fullScreenLoading: Boolean = true,
|
||||
val buttonLoading: Boolean = false,
|
||||
)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 479 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 192 KiB |
Loading…
Add table
Add a link
Reference in a new issue