Updated on 2026-08-14
This commit is contained in:
parent
e8cd53de9c
commit
6c41eefe0b
3 changed files with 20 additions and 27 deletions
|
|
@ -108,14 +108,11 @@ internal fun TangemPayCard(state: TangemPayCardDetailsUM, modifier: Modifier = M
|
|||
@Suppress("LongMethod", "DestructuringDeclarationWithTooManyEntries")
|
||||
@Composable
|
||||
private fun TangemPayCardDetailsHiddenBlock(state: TangemPayCardDetailsUM, modifier: Modifier = Modifier) {
|
||||
val isRenaming = state.displayNameState is DisplayNameState.Editing
|
||||
|
||||
Box(modifier = modifier.fillMaxSize()) {
|
||||
TangemPayCardBackground(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.zIndex(0f),
|
||||
isRenaming = isRenaming,
|
||||
cardFrozenState = state.cardFrozenState,
|
||||
)
|
||||
|
||||
|
|
@ -147,6 +144,7 @@ private fun TangemPayCardDetailsHiddenBlock(state: TangemPayCardDetailsUM, modif
|
|||
)
|
||||
}
|
||||
CardNumberBlock(
|
||||
isRenaming = state.displayNameState is DisplayNameState.Editing,
|
||||
numberShort = state.numberShort,
|
||||
cardNumberRef = cardNumberRef,
|
||||
)
|
||||
|
|
@ -203,11 +201,7 @@ private fun TangemPayCardDetailsHiddenBlock(state: TangemPayCardDetailsUM, modif
|
|||
}
|
||||
|
||||
@Composable
|
||||
private fun TangemPayCardBackground(
|
||||
isRenaming: Boolean,
|
||||
cardFrozenState: TangemPayCardFrozenState,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
private fun TangemPayCardBackground(cardFrozenState: TangemPayCardFrozenState, modifier: Modifier = Modifier) {
|
||||
val isFrozen = cardFrozenState == TangemPayCardFrozenState.Frozen
|
||||
val freezeProgress by animateFloatAsState(
|
||||
targetValue = if (isFrozen) 1f else 0f,
|
||||
|
|
@ -225,14 +219,6 @@ private fun TangemPayCardBackground(
|
|||
contentDescription = null,
|
||||
)
|
||||
|
||||
if (isRenaming && LocalVisaRedesignEnabled.current) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(CardBackgroundColor.copy(alpha = 0.8f)),
|
||||
)
|
||||
}
|
||||
|
||||
if (isFrozen || freezeProgress > 0f) {
|
||||
Image(
|
||||
modifier = Modifier
|
||||
|
|
@ -344,6 +330,7 @@ private fun CardTopBlock(modifier: Modifier = Modifier) {
|
|||
|
||||
@Composable
|
||||
private fun ConstraintLayoutScope.CardNumberBlock(
|
||||
isRenaming: Boolean,
|
||||
numberShort: String,
|
||||
cardNumberRef: ConstrainedLayoutReference,
|
||||
modifier: Modifier = Modifier,
|
||||
|
|
@ -352,7 +339,11 @@ private fun ConstraintLayoutScope.CardNumberBlock(
|
|||
Text(
|
||||
text = numberShort,
|
||||
style = TangemTheme.typography3.body.medium,
|
||||
color = TangemTheme.colors3.text.staticDark.primary,
|
||||
color = if (isRenaming) {
|
||||
TangemTheme.colors3.text.staticDark.secondary
|
||||
} else {
|
||||
TangemTheme.colors3.text.staticDark.primary
|
||||
},
|
||||
modifier = modifier
|
||||
.constrainAs(cardNumberRef) {
|
||||
start.linkTo(parent.start)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import com.tangem.core.ui.extensions.resolveReference
|
|||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.stringResourceSafe
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.res.TangemThemePreviewRedesign
|
||||
import com.tangem.core.ui.res.generated.icons.Icons
|
||||
import com.tangem.core.ui.res.generated.icons.ic_cross_20
|
||||
import com.tangem.core.ui.test.TangemPayTestTags
|
||||
|
|
@ -54,7 +54,7 @@ internal fun TangemPayChangePinScreenV2(
|
|||
.statusBarsPadding(),
|
||||
) {
|
||||
TangemTopBar(
|
||||
title = resourceReference(R.string.tangempay_set_pin_title),
|
||||
title = resourceReference(R.string.visa_onboarding_pin_code_title),
|
||||
endContent = {
|
||||
TangemButton(
|
||||
iconStart = TangemIconUM.Icon(imageVector = Icons.ic_cross_20),
|
||||
|
|
@ -73,7 +73,7 @@ internal fun TangemPayChangePinScreenV2(
|
|||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
Text(
|
||||
text = stringResourceSafe(R.string.tangempay_set_pin_header),
|
||||
text = stringResourceSafe(R.string.visa_onboarding_pin_code_description),
|
||||
style = TangemTheme.typography3.body.medium,
|
||||
color = TangemTheme.colors3.text.secondary,
|
||||
textAlign = TextAlign.Center,
|
||||
|
|
@ -94,6 +94,7 @@ private fun PinCodeSection(state: TangemPayChangePinUM, modifier: Modifier = Mod
|
|||
val focusRequester = remember { FocusRequester() }
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = modifier) {
|
||||
PinCode(
|
||||
isError = state.error != null,
|
||||
value = state.pinCode,
|
||||
onValueChange = state.onPinCodeChange,
|
||||
focusRequester = focusRequester,
|
||||
|
|
@ -109,7 +110,7 @@ private fun PinCodeSection(state: TangemPayChangePinUM, modifier: Modifier = Mod
|
|||
Text(
|
||||
text = error.resolveReference(),
|
||||
style = TangemTheme.typography3.caption.medium,
|
||||
color = TangemTheme.colors3.text.status.warning,
|
||||
color = TangemTheme.colors3.text.status.error,
|
||||
textAlign = TextAlign.Center,
|
||||
modifier = Modifier.testTag(TangemPayTestTags.PIN_ERROR_MESSAGE),
|
||||
)
|
||||
|
|
@ -125,6 +126,7 @@ private fun PinCodeSection(state: TangemPayChangePinUM, modifier: Modifier = Mod
|
|||
|
||||
@Composable
|
||||
private fun PinCode(
|
||||
isError: Boolean,
|
||||
value: String,
|
||||
onValueChange: (String) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
|
|
@ -180,10 +182,10 @@ private fun PinCode(
|
|||
),
|
||||
digit = digit,
|
||||
backgroundColor = TangemTheme.colors3.bg.opaque.primary,
|
||||
borderColor = if (isActive) {
|
||||
TangemTheme.colors3.border.status.info
|
||||
} else {
|
||||
TangemTheme.colors3.border.secondary
|
||||
borderColor = when {
|
||||
isError -> TangemTheme.colors3.border.status.error
|
||||
isActive -> TangemTheme.colors3.border.status.info
|
||||
else -> TangemTheme.colors3.border.secondary
|
||||
},
|
||||
textColor = TangemTheme.colors3.text.primary,
|
||||
textStyle = TangemTheme.typography3.heading.medium,
|
||||
|
|
@ -201,7 +203,7 @@ private fun PinCode(
|
|||
private fun TangemPayChangePinScreenV2Preview(
|
||||
@PreviewParameter(TangemPayChangePinUMPreviewProvider::class) state: TangemPayChangePinUM,
|
||||
) {
|
||||
TangemThemePreview {
|
||||
TangemThemePreviewRedesign {
|
||||
TangemPayChangePinScreenV2(
|
||||
state = state,
|
||||
onBackClick = {},
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ internal fun TangemPayEditDisplayNameScreenV2(
|
|||
.fillMaxWidth()
|
||||
.padding(vertical = TangemTheme.dimens2.x3, horizontal = TangemTheme.dimens2.x4)
|
||||
.imePadding(),
|
||||
text = resourceReference(R.string.common_save),
|
||||
text = resourceReference(R.string.common_done),
|
||||
onClick = state.onDoneClick,
|
||||
isLoading = state.isLoading,
|
||||
isEnabled = !state.isLoading && state.isDoneEnabled,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue