From c5e437586bb6f89bb6a07997f23f7be9a8d3edc8 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 12 Sep 2025 16:32:29 +0500 Subject: [PATCH] Updated on 2026-08-14 --- core/res/src/main/res/values-ja/strings.xml | 2 +- core/res/src/main/res/values/strings.xml | 21 ++++--- .../tangem/core/ui/components/label/Label.kt | 62 +++++++++++++++---- .../ui/components/label/entity/LabelUM.kt | 3 + .../main/res/drawable/ic_analytics_up_24.xml | 9 +++ .../src/main/res/drawable/ic_flash_new_24.xml | 9 +++ .../ui/src/main/res/drawable/ic_repeat_24.xml | 10 +++ .../res/drawable/ic_security_check_24.xml | 9 +++ 8 files changed, 102 insertions(+), 23 deletions(-) create mode 100644 core/ui/src/main/res/drawable/ic_analytics_up_24.xml create mode 100644 core/ui/src/main/res/drawable/ic_flash_new_24.xml create mode 100644 core/ui/src/main/res/drawable/ic_repeat_24.xml create mode 100644 core/ui/src/main/res/drawable/ic_security_check_24.xml diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index 0ec41dbaeb..50f599d85a 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -1657,7 +1657,7 @@ Aaveは世界中で何百万人もの人々に信頼されています。総貸付額は104億ドルです。 分散型・自己管理型 サービスを使用することにより、プロバイダーに同意したものとみなされます - 年間%s%の収益 + 年間%s%%の収益 Aave • 変動金利 Aave 平均%s diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 4db0f5063e..fb4b2b7a3b 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -200,6 +200,7 @@ You have not given access to your camera, please adjust your privacy settings Cancel Change + Choose account Choose action Choose network Choose token @@ -1266,6 +1267,14 @@ You receive Choose token not available + Get card + Add to your wallet and pay with your phone anywhere. + Apple Pay & Google Pay + Use your USDC balance to pay for everyday purchases seamlessly. + Everyday purchases + Your card details are protected — full control in the app. + Built-in security + Get your free Crypto Card\nin minutes This is my wallet Balances hidden Balances shown @@ -1414,14 +1423,6 @@ Unlock Scan your card to unlock access Needed unlock - Get your free Crypto Card\nin minutes - Built-in security - Your card details are protected — full control in the app. - Everyday purchases - Use your USDC balance to pay for everyday purchases seamlessly. - Apple Pay & Google Pay - Add to your wallet and pay with your phone anywhere. - Get card Blockchain is unreachable. Try later Scan card or ring 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. @@ -1732,8 +1733,8 @@ How it works? Aave is trusted by millions worldwide. Total lended value is $10.4B. Decentralized and self-custodial - By using service, you agree with provider - Earn %s% yearly + By using service, you agree with provider %1$s and %2$s + Earn %s%% yearly Aave • Variable Interest Rate Aave Avg %s diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/label/Label.kt b/core/ui/src/main/java/com/tangem/core/ui/components/label/Label.kt index 7e95a24776..86dacb20d6 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/label/Label.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/label/Label.kt @@ -2,19 +2,22 @@ package com.tangem.core.ui.components.label import android.content.res.Configuration import androidx.compose.animation.AnimatedContent +import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.animateColorAsState import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.* +import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource 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.label.entity.LabelStyle import com.tangem.core.ui.components.label.entity.LabelUM import com.tangem.core.ui.extensions.TextReference @@ -48,8 +51,18 @@ fun Label(state: LabelUM, modifier: Modifier = Modifier) { }, ) + val iconColor by animateColorAsState( + targetValue = when (state.style) { + LabelStyle.ACCENT -> TangemTheme.colors.icon.accent + LabelStyle.REGULAR -> TangemTheme.colors.icon.informative + LabelStyle.WARNING -> TangemTheme.colors.icon.warning + }, + ) + AnimatedContent(targetState = state.text) { text -> - Box( + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(4.dp), modifier = modifier .padding(horizontal = 4.dp) .background( @@ -63,6 +76,15 @@ fun Label(state: LabelUM, modifier: Modifier = Modifier) { style = TangemTheme.typography.caption1, color = textColor, ) + AnimatedVisibility(state.icon != null) { + val wrappedIcon = remember(this) { requireNotNull(state.icon) } + Icon( + imageVector = ImageVector.vectorResource(wrappedIcon), + tint = iconColor, + contentDescription = null, + modifier = Modifier.size(16.dp), + ) + } } } } @@ -73,6 +95,7 @@ fun Label(state: LabelUM, modifier: Modifier = Modifier) { private fun LabelPreview() { TangemThemePreview { Column( + verticalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(16.dp), ) { Label( @@ -81,24 +104,39 @@ private fun LabelPreview() { style = LabelStyle.REGULAR, ), ) - - Spacer(modifier = Modifier.height(8.dp)) - Label( state = LabelUM( text = TextReference.Str("Accent Label"), style = LabelStyle.ACCENT, ), ) - - Spacer(modifier = Modifier.height(8.dp)) - Label( state = LabelUM( text = TextReference.Str("Warning Label"), style = LabelStyle.WARNING, ), ) + Label( + state = LabelUM( + text = TextReference.Str("Regular Label"), + style = LabelStyle.REGULAR, + icon = R.drawable.ic_information_24, + ), + ) + Label( + state = LabelUM( + text = TextReference.Str("Accent Label"), + style = LabelStyle.ACCENT, + icon = R.drawable.ic_information_24, + ), + ) + Label( + state = LabelUM( + text = TextReference.Str("Warning Label"), + style = LabelStyle.WARNING, + icon = R.drawable.ic_information_24, + ), + ) } } } \ No newline at end of file diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/label/entity/LabelUM.kt b/core/ui/src/main/java/com/tangem/core/ui/components/label/entity/LabelUM.kt index 70b134bfe8..1be654c994 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/label/entity/LabelUM.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/label/entity/LabelUM.kt @@ -1,10 +1,13 @@ package com.tangem.core.ui.components.label.entity +import androidx.annotation.DrawableRes import com.tangem.core.ui.extensions.TextReference data class LabelUM( val text: TextReference, val style: LabelStyle, + @DrawableRes val icon: Int? = null, + val onIconClick: (() -> Unit)? = null, ) enum class LabelStyle { diff --git a/core/ui/src/main/res/drawable/ic_analytics_up_24.xml b/core/ui/src/main/res/drawable/ic_analytics_up_24.xml new file mode 100644 index 0000000000..be13c86516 --- /dev/null +++ b/core/ui/src/main/res/drawable/ic_analytics_up_24.xml @@ -0,0 +1,9 @@ + + + diff --git a/core/ui/src/main/res/drawable/ic_flash_new_24.xml b/core/ui/src/main/res/drawable/ic_flash_new_24.xml new file mode 100644 index 0000000000..71ad60eda8 --- /dev/null +++ b/core/ui/src/main/res/drawable/ic_flash_new_24.xml @@ -0,0 +1,9 @@ + + + diff --git a/core/ui/src/main/res/drawable/ic_repeat_24.xml b/core/ui/src/main/res/drawable/ic_repeat_24.xml new file mode 100644 index 0000000000..deb5797a0b --- /dev/null +++ b/core/ui/src/main/res/drawable/ic_repeat_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/core/ui/src/main/res/drawable/ic_security_check_24.xml b/core/ui/src/main/res/drawable/ic_security_check_24.xml new file mode 100644 index 0000000000..8a64f5924c --- /dev/null +++ b/core/ui/src/main/res/drawable/ic_security_check_24.xml @@ -0,0 +1,9 @@ + + +