From 8962f8d333186237a169c8a4652c7464052c4cd9 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 10 Oct 2023 12:07:39 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../ui/components/AddCustomTokenForm.kt | 4 +- .../details/ui/details/DetailsScreen.kt | 2 +- .../ui/components/SaveWalletScreenContent.kt | 2 +- .../wallet/ui/view/TotalBalanceCard.kt | 2 +- .../ui/components/WalletItem.kt | 4 +- .../tangem/core/ui/components/TextFields.kt | 5 +- .../ui/components/appbar/AppBarWithSearch.kt | 2 +- .../tokenreceive/TokenReceiveBottomSheet.kt | 2 +- .../components/notifications/Notification.kt | 2 +- .../ui/components/transactions/Transaction.kt | 4 +- .../com/tangem/core/ui/res/TangemTheme.kt | 9 ++-- .../tangem/core/ui/res/TangemTypography.kt | 50 ++++++++++++++----- .../presentation/ui/GetBonusView.kt | 5 +- .../ui/Learn2earnStoriesScreen.kt | 3 +- .../wallet2/ui/ImportSeedPhraseScreen.kt | 2 +- .../feature/referral/ui/AgreementText.kt | 2 +- .../feature/swap/ui/SwapSelectTokenScreen.kt | 6 +-- .../TokenDetailsLoadedBalanceConverter.kt | 26 +++++----- .../ui/components/TokenDetailsBalanceBlock.kt | 4 +- .../ui/components/TokenInfoBlock.kt | 8 +-- .../component/token/NonFiatContentBlock.kt | 3 +- .../component/token/TokenCryptoAmount.kt | 3 +- .../common/component/token/TokenFiatAmount.kt | 3 +- .../component/token/TokenPriceChange.kt | 3 +- .../common/component/token/TokenTitle.kt | 3 +- .../wallet/ui/components/common/WalletCard.kt | 2 +- .../multicurrency/MultiCurrencyContent.kt | 2 +- 27 files changed, 87 insertions(+), 76 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/ui/components/AddCustomTokenForm.kt b/app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/ui/components/AddCustomTokenForm.kt index 0090ef8223..fb6c260728 100644 --- a/app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/ui/components/AddCustomTokenForm.kt +++ b/app/src/main/java/com/tangem/tap/features/customtoken/impl/presentation/ui/components/AddCustomTokenForm.kt @@ -94,7 +94,7 @@ private fun TextField(model: AddCustomTokenInputField, isError: Boolean) { label = { Text( text = model.label.resolveReference(), - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTextFieldsDefault.defaultTextFieldColors.labelColor( enabled = isEnabled, error = isError, @@ -178,7 +178,7 @@ private fun SelectorField(model: AddCustomTokenSelectorField) { text = subtitle, color = TangemTheme.colors.text.secondary, maxLines = 1, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } } diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/details/DetailsScreen.kt b/app/src/main/java/com/tangem/tap/features/details/ui/details/DetailsScreen.kt index 1d074d274a..8a65d0e7bd 100644 --- a/app/src/main/java/com/tangem/tap/features/details/ui/details/DetailsScreen.kt +++ b/app/src/main/java/com/tangem/tap/features/details/ui/details/DetailsScreen.kt @@ -229,7 +229,7 @@ private fun TangemAppVersion(appNameRes: Int, version: String, modifier: Modifie Text( modifier = modifier.padding(horizontal = TangemTheme.dimens.spacing16), text = "${stringResource(id = appNameRes)} $version", - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, ) } diff --git a/app/src/main/java/com/tangem/tap/features/saveWallet/ui/components/SaveWalletScreenContent.kt b/app/src/main/java/com/tangem/tap/features/saveWallet/ui/components/SaveWalletScreenContent.kt index a20a0edf59..a8bbc46f02 100644 --- a/app/src/main/java/com/tangem/tap/features/saveWallet/ui/components/SaveWalletScreenContent.kt +++ b/app/src/main/java/com/tangem/tap/features/saveWallet/ui/components/SaveWalletScreenContent.kt @@ -144,7 +144,7 @@ private fun Footer(showProgress: Boolean, onSaveWalletClick: () -> Unit) { Text( modifier = Modifier.fillMaxWidth(fraction = .7f), text = stringResource(R.string.save_user_wallet_agreement_notice), - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, textAlign = TextAlign.Center, ) diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/view/TotalBalanceCard.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/view/TotalBalanceCard.kt index fdfadc43e1..d39bf43e05 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/view/TotalBalanceCard.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/view/TotalBalanceCard.kt @@ -134,7 +134,7 @@ private fun TotalBalanceCardContent(state: TotalBalanceCardState, modifier: Modi Text( modifier = Modifier.fillMaxWidth(), text = stringResource(id = R.string.main_processing_full_amount), - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.attention, ) } diff --git a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WalletItem.kt b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WalletItem.kt index 62ef2c0468..0224ee04fc 100644 --- a/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WalletItem.kt +++ b/app/src/main/java/com/tangem/tap/features/walletSelector/ui/components/WalletItem.kt @@ -151,7 +151,7 @@ private fun RowScope.WalletInfo(wallet: UserWalletItem, isSelected: Boolean) { }, color = TangemTheme.colors.text.tertiary, maxLines = 1, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } } @@ -255,7 +255,7 @@ private fun LoadedTokensInfo( count = tokensCount, tokensCount, ), - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, textAlign = TextAlign.End, ) diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/TextFields.kt b/core/ui/src/main/java/com/tangem/core/ui/components/TextFields.kt index 6f09757064..e954cbd32d 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/TextFields.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/TextFields.kt @@ -25,7 +25,6 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import com.tangem.core.ui.R import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemTypography /** * [Show in Figma](https://www.figma.com/file/14ISV23YB1yVW1uNVwqrKv/Android?node-id=213%3A218&t=TmfD6UBHPg9uYfev-4) @@ -103,7 +102,7 @@ private fun TangemTextField( if (!label.isNullOrEmpty()) { Text( text = label, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = colors.labelColor( enabled = enabled, error = isError, @@ -161,7 +160,7 @@ private fun TangemTextField( .fillMaxWidth() .padding(horizontal = 16.dp), text = caption, - style = TangemTypography.body1, + style = TangemTheme.typography.body1, color = colors.captionColor(enabled = enabled, isError = isError).value, ) } diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/appbar/AppBarWithSearch.kt b/core/ui/src/main/java/com/tangem/core/ui/components/appbar/AppBarWithSearch.kt index 55b0a08fe3..b88991e655 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/appbar/AppBarWithSearch.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/appbar/AppBarWithSearch.kt @@ -169,7 +169,7 @@ private fun SubtitleView(subtitle: String, icon: Painter?) { text = subtitle, color = TangemTheme.colors.text.secondary, maxLines = 1, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } } diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/tokenreceive/TokenReceiveBottomSheet.kt b/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/tokenreceive/TokenReceiveBottomSheet.kt index ee8b8d3581..ce07dc5ba7 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/tokenreceive/TokenReceiveBottomSheet.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/bottomsheets/tokenreceive/TokenReceiveBottomSheet.kt @@ -63,7 +63,7 @@ private fun TokenReceiveBottomSheetContent(content: TokenReceiveBottomSheetConfi text = stringResource(R.string.receive_bottom_sheet_warning_message_full, content.name), color = TangemTheme.colors.text.secondary, textAlign = TextAlign.Center, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) Row( horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing16), diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/notifications/Notification.kt b/core/ui/src/main/java/com/tangem/core/ui/components/notifications/Notification.kt index 6e569c56bb..56b449ec3a 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/notifications/Notification.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/notifications/Notification.kt @@ -157,7 +157,7 @@ private fun TextsBlock(title: TextReference, subtitle: TextReference) { Text( text = subtitle.resolveReference(), color = TangemTheme.colors.text.tertiary, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } } diff --git a/core/ui/src/main/java/com/tangem/core/ui/components/transactions/Transaction.kt b/core/ui/src/main/java/com/tangem/core/ui/components/transactions/Transaction.kt index 283bbf7b89..4cbbb22026 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/components/transactions/Transaction.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/components/transactions/Transaction.kt @@ -251,7 +251,7 @@ private fun Subtitle(state: TransactionState, modifier: Modifier = Modifier) { modifier = modifier, textAlign = TextAlign.Start, color = TangemTheme.colors.text.tertiary, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } is TransactionState.Loading -> { @@ -304,7 +304,7 @@ private fun Timestamp(state: TransactionState, modifier: Modifier = Modifier) { modifier = modifier, textAlign = TextAlign.End, color = TangemTheme.colors.text.tertiary, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } is TransactionState.Loading -> { diff --git a/core/ui/src/main/java/com/tangem/core/ui/res/TangemTheme.kt b/core/ui/src/main/java/com/tangem/core/ui/res/TangemTheme.kt index 293956cef6..a4f6721f5c 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/res/TangemTheme.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/res/TangemTheme.kt @@ -3,7 +3,6 @@ package com.tangem.core.ui.res import androidx.compose.material.Colors import androidx.compose.material.MaterialTheme import androidx.compose.material.ProvideTextStyle -import androidx.compose.material.Typography import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.ReadOnlyComposable @@ -17,7 +16,7 @@ internal const val IS_SYSTEM_IN_DARK_THEME: Boolean = false @Composable fun TangemTheme( isDark: Boolean = false, - typography: Typography = TangemTheme.typography, + typography: TangemTypography = TangemTheme.typography, dimens: TangemDimens = TangemTheme.dimens, content: @Composable () -> Unit, ) { @@ -26,10 +25,8 @@ fun TangemTheme( .also { it.update(themeColors) } val shapes = remember { TangemShapes(dimens) } - MaterialTheme( colors = materialThemeColors(colors = themeColors, isDark = isDark), - typography = typography, ) { CompositionLocalProvider( LocalTangemColors provides rememberedColors, @@ -52,7 +49,7 @@ object TangemTheme { @ReadOnlyComposable get() = LocalTangemColors.current - val typography: Typography + val typography: TangemTypography @Composable @ReadOnlyComposable get() = LocalTangemTypography.current @@ -197,7 +194,7 @@ private val LocalTangemColors = staticCompositionLocalOf { } private val LocalTangemTypography = staticCompositionLocalOf { - TangemTypography + TangemTypography() } private val LocalTangemDimens = staticCompositionLocalOf { diff --git a/core/ui/src/main/java/com/tangem/core/ui/res/TangemTypography.kt b/core/ui/src/main/java/com/tangem/core/ui/res/TangemTypography.kt index bdcd413dbd..0187255098 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/res/TangemTypography.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/res/TangemTypography.kt @@ -1,6 +1,6 @@ package com.tangem.core.ui.res -import androidx.compose.material.Typography +import androidx.compose.runtime.Immutable import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily @@ -15,63 +15,87 @@ private val RobotoFamily = FontFamily( Font(R.font.roboto_medium, FontWeight.Medium), ) -val TangemTypography = Typography( - defaultFontFamily = RobotoFamily, - h1 = TextStyle( +@Immutable +data class TangemTypography internal constructor( + val head: TextStyle = TextStyle( + fontFamily = RobotoFamily, + fontSize = 34.sp, + fontWeight = FontWeight.SemiBold, + letterSpacing = TextUnit(value = 0f, type = TextUnitType.Sp), + lineHeight = TextUnit(value = 44f, type = TextUnitType.Sp), + ), + val h1: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 34.sp, fontWeight = FontWeight.Normal, letterSpacing = TextUnit(value = 0f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 44f, type = TextUnitType.Sp), ), - h2 = TextStyle( + val h2: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 24.sp, fontWeight = FontWeight.Medium, letterSpacing = TextUnit(value = 0.18f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 32f, type = TextUnitType.Sp), ), - h3 = TextStyle( + val h3: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 20.sp, fontWeight = FontWeight.Medium, letterSpacing = TextUnit(value = 0.15f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 24f, type = TextUnitType.Sp), ), - subtitle1 = TextStyle( + val subtitle1: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 16.sp, fontWeight = FontWeight.Medium, letterSpacing = TextUnit(value = 0.15f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 24f, type = TextUnitType.Sp), ), - subtitle2 = TextStyle( + val subtitle2: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 14.sp, fontWeight = FontWeight.Medium, letterSpacing = TextUnit(value = 0.5f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 24f, type = TextUnitType.Sp), ), - body1 = TextStyle( + val body1: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 16.sp, fontWeight = FontWeight.Normal, letterSpacing = TextUnit(value = 0.5f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 24f, type = TextUnitType.Sp), ), - body2 = TextStyle( + val body2: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 14.sp, fontWeight = FontWeight.Normal, letterSpacing = TextUnit(value = 0.25f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 20f, type = TextUnitType.Sp), ), - button = TextStyle( + val button: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 14.sp, fontWeight = FontWeight.Medium, letterSpacing = TextUnit(value = 0.1f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 16f, type = TextUnitType.Sp), ), - caption = TextStyle( + val caption1: TextStyle = TextStyle( + fontFamily = RobotoFamily, + fontSize = 12.sp, + fontWeight = FontWeight.Medium, + letterSpacing = TextUnit(value = 0.4f, type = TextUnitType.Sp), + lineHeight = TextUnit(value = 16f, type = TextUnitType.Sp), + ), + val caption2: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 12.sp, fontWeight = FontWeight.Normal, letterSpacing = TextUnit(value = 0.4f, type = TextUnitType.Sp), lineHeight = TextUnit(value = 16f, type = TextUnitType.Sp), ), - overline = TextStyle( + val overline: TextStyle = TextStyle( + fontFamily = RobotoFamily, fontSize = 10.sp, fontWeight = FontWeight.Medium, letterSpacing = TextUnit(value = 1.5f, type = TextUnitType.Sp), diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/GetBonusView.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/GetBonusView.kt index a36d44f760..792105fb40 100644 --- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/GetBonusView.kt +++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/GetBonusView.kt @@ -22,7 +22,6 @@ import com.tangem.core.ui.components.SpacerH4 import com.tangem.core.ui.extensions.resolveReference import com.tangem.core.ui.res.TangemColorPalette import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemTypography import com.tangem.feature.learn2earn.impl.R import com.tangem.feature.learn2earn.presentation.ui.component.GradientCircle import com.tangem.feature.learn2earn.presentation.ui.state.MainScreenState @@ -70,13 +69,13 @@ internal fun GetBonusView(state: MainScreenState, modifier: Modifier = Modifier) ) { Text( text = state.description.title.resolveReference(), - style = TangemTypography.body1, + style = TangemTheme.typography.body1, color = TangemTheme.colors.text.primary2, ) SpacerH4() Text( text = state.description.subtitle.resolveReference(), - style = TangemTypography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, ) } diff --git a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/Learn2earnStoriesScreen.kt b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/Learn2earnStoriesScreen.kt index b91ffaf2f5..4d498fd377 100644 --- a/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/Learn2earnStoriesScreen.kt +++ b/features/learn2earn/impl/src/main/java/com/tangem/feature/learn2earn/presentation/ui/Learn2earnStoriesScreen.kt @@ -17,7 +17,6 @@ import com.tangem.core.ui.components.SecondaryButton import com.tangem.core.ui.components.SpacerH16 import com.tangem.core.ui.components.SpacerH32 import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemTypography import com.tangem.feature.learn2earn.impl.R import com.tangem.feature.learn2earn.presentation.ui.component.GradientCircle @@ -106,7 +105,7 @@ private fun StoryDescription(headerText: String, bodyText: String, modifier: Mod Text( text = bodyText, textAlign = TextAlign.Center, - style = TangemTypography.subtitle1, + style = TangemTheme.typography.subtitle1, color = TangemTheme.colors.text.tertiary, ) } diff --git a/features/onboarding/src/main/java/com/tangem/feature/onboarding/presentation/wallet2/ui/ImportSeedPhraseScreen.kt b/features/onboarding/src/main/java/com/tangem/feature/onboarding/presentation/wallet2/ui/ImportSeedPhraseScreen.kt index 5f9b14ae11..10248b767a 100644 --- a/features/onboarding/src/main/java/com/tangem/feature/onboarding/presentation/wallet2/ui/ImportSeedPhraseScreen.kt +++ b/features/onboarding/src/main/java/com/tangem/feature/onboarding/presentation/wallet2/ui/ImportSeedPhraseScreen.kt @@ -112,7 +112,7 @@ private fun PhraseBlock(state: ImportSeedPhraseState, modifier: Modifier = Modif Text( modifier = Modifier.fillMaxSize(), text = message, - style = TangemTheme.typography.caption.copy( + style = TangemTheme.typography.caption2.copy( color = TangemTheme.colors.text.warning, ), ) diff --git a/features/referral/presentation/src/main/java/com/tangem/feature/referral/ui/AgreementText.kt b/features/referral/presentation/src/main/java/com/tangem/feature/referral/ui/AgreementText.kt index c143b3b4e5..d29a6c996b 100644 --- a/features/referral/presentation/src/main/java/com/tangem/feature/referral/ui/AgreementText.kt +++ b/features/referral/presentation/src/main/java/com/tangem/feature/referral/ui/AgreementText.kt @@ -26,7 +26,7 @@ internal fun AgreementText(@StringRes firstPartResId: Int, onClick: () -> Unit) modifier = Modifier .fillMaxWidth() .padding(horizontal = TangemTheme.dimens.spacing54), - style = TangemTheme.typography.caption.copy(textAlign = TextAlign.Center), + style = TangemTheme.typography.caption2.copy(textAlign = TextAlign.Center), maxLines = 2, onClick = { val clickableSpanStyle = requireNotNull(agreementText.spanStyles.getOrNull(1)) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapSelectTokenScreen.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapSelectTokenScreen.kt index eb086a8df4..23647ff1d8 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapSelectTokenScreen.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapSelectTokenScreen.kt @@ -150,7 +150,7 @@ private fun TokenItem(token: TokenToSelect, network: Network, onTokenClick: () - SpacerW2() Text( text = token.symbol, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, ) } @@ -160,7 +160,7 @@ private fun TokenItem(token: TokenToSelect, network: Network, onTokenClick: () - if (!token.available) { Text( text = stringResource(id = R.string.swapping_token_not_available), - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, ) } else if (token.addedTokenBalanceData != null) { @@ -177,7 +177,7 @@ private fun TokenItem(token: TokenToSelect, network: Network, onTokenClick: () - SpacerW2() Text( text = token.addedTokenBalanceData.amount.orEmpty(), - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, ) } diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsLoadedBalanceConverter.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsLoadedBalanceConverter.kt index 9240092123..cf82bb5725 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsLoadedBalanceConverter.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsLoadedBalanceConverter.kt @@ -59,24 +59,22 @@ internal class TokenDetailsLoadedBalanceConverter( return when (status.value) { is CryptoCurrencyStatus.NoQuote, is CryptoCurrencyStatus.Loaded, - -> { - TokenDetailsBalanceBlockState.Content( - actionButtons = currentState.actionButtons, - fiatBalance = formatFiatAmount(status.value, appCurrencyProvider()), - cryptoBalance = formatCryptoAmount(status), - ) - } - is CryptoCurrencyStatus.Loading -> { - TokenDetailsBalanceBlockState.Loading(currentState.actionButtons) - } + -> TokenDetailsBalanceBlockState.Content( + actionButtons = currentState.actionButtons, + fiatBalance = formatFiatAmount(status.value, appCurrencyProvider()), + cryptoBalance = formatCryptoAmount(status), + ) + is CryptoCurrencyStatus.NoAccount -> TokenDetailsBalanceBlockState.Content( + actionButtons = currentState.actionButtons, + fiatBalance = formatFiatAmount(status.value, appCurrencyProvider()), + cryptoBalance = formatCryptoAmount(status), + ) + is CryptoCurrencyStatus.Loading -> TokenDetailsBalanceBlockState.Loading(currentState.actionButtons) is CryptoCurrencyStatus.MissedDerivation, - is CryptoCurrencyStatus.NoAccount, is CryptoCurrencyStatus.Custom, is CryptoCurrencyStatus.NoAmount, is CryptoCurrencyStatus.Unreachable, - -> { - TokenDetailsBalanceBlockState.Error(currentState.actionButtons) - } + -> TokenDetailsBalanceBlockState.Error(currentState.actionButtons) } } diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenDetailsBalanceBlock.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenDetailsBalanceBlock.kt index 0fc3606d9b..2df27ff04c 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenDetailsBalanceBlock.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenDetailsBalanceBlock.kt @@ -112,13 +112,13 @@ private fun CryptoBalance( is TokenDetailsBalanceBlockState.Content -> Text( modifier = modifier, text = if (isBalanceHidden) STARS else state.cryptoBalance, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, ) is TokenDetailsBalanceBlockState.Error -> Text( modifier = modifier, text = BigDecimalFormatter.EMPTY_BALANCE_SIGN, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, ) } diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt index 4d149f38c8..7ccdf694b5 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt @@ -34,7 +34,7 @@ internal fun TokenInfoBlock(state: TokenInfoBlockState, modifier: Modifier = Mod ) { Text( text = state.name, - style = TangemTheme.typography.h1, + style = TangemTheme.typography.head, color = TangemTheme.colors.text.primary1, ) NetworkInfoText(state.currency) @@ -63,7 +63,7 @@ private fun NetworkInfoText(currency: TokenInfoBlockState.Currency) { Text( text = stringResource(id = R.string.common_main_network), color = TangemTheme.colors.text.tertiary, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } is TokenInfoBlockState.Currency.Token -> { @@ -74,7 +74,7 @@ private fun NetworkInfoText(currency: TokenInfoBlockState.Currency) { val state = extractNetwork(tokenCurrency = currency) Text( text = state.normalText, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, color = TangemTheme.colors.text.tertiary, ) Icon( @@ -85,7 +85,7 @@ private fun NetworkInfoText(currency: TokenInfoBlockState.Currency) { ) Text( text = state.boldText, - style = TangemTheme.typography.caption.copy(fontWeight = FontWeight.Medium), + style = TangemTheme.typography.caption2.copy(fontWeight = FontWeight.Medium), color = TangemTheme.colors.text.primary1, ) } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/NonFiatContentBlock.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/NonFiatContentBlock.kt index cb5c920555..478991676d 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/NonFiatContentBlock.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/NonFiatContentBlock.kt @@ -14,7 +14,6 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemTypography import com.tangem.feature.wallet.impl.R import com.tangem.feature.wallet.presentation.common.state.TokenItemState import org.burnoutcrew.reorderable.ReorderableLazyListState @@ -73,6 +72,6 @@ private fun NonFiatContentText(@StringRes text: Int) { color = TangemTheme.colors.text.tertiary, maxLines = 1, overflow = TextOverflow.Ellipsis, - style = TangemTypography.body2, + style = TangemTheme.typography.body2, ) } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenCryptoAmount.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenCryptoAmount.kt index 74d1cf836f..426d6d153a 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenCryptoAmount.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenCryptoAmount.kt @@ -11,7 +11,6 @@ import androidx.compose.ui.text.style.TextOverflow import com.tangem.common.Strings import com.tangem.core.ui.components.RectangleShimmer import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemTypography import com.tangem.feature.wallet.impl.R import com.tangem.feature.wallet.presentation.common.state.TokenItemState.CryptoAmountState as TokenCryptoAmountState @@ -49,7 +48,7 @@ private fun CryptoAmountText(amount: String, modifier: Modifier = Modifier) { color = TangemTheme.colors.text.tertiary, maxLines = 1, overflow = TextOverflow.Ellipsis, - style = TangemTypography.body2, + style = TangemTheme.typography.body2, ) } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenFiatAmount.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenFiatAmount.kt index 6aff7c7e1c..f223ecdcfe 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenFiatAmount.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenFiatAmount.kt @@ -10,7 +10,6 @@ import androidx.compose.ui.text.style.TextOverflow import com.tangem.common.Strings import com.tangem.core.ui.components.RectangleShimmer import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemTypography import com.tangem.feature.wallet.presentation.common.state.TokenItemState.FiatAmountState as TokenFiatAmountState @Composable @@ -40,7 +39,7 @@ private fun FiatAmountText(text: String, modifier: Modifier = Modifier) { color = TangemTheme.colors.text.primary1, maxLines = 1, overflow = TextOverflow.Ellipsis, - style = TangemTypography.body2, + style = TangemTheme.typography.body2, ) } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenPriceChange.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenPriceChange.kt index 002357512e..d40de53a30 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenPriceChange.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenPriceChange.kt @@ -15,7 +15,6 @@ import com.tangem.core.ui.components.RectangleShimmer import com.tangem.core.ui.components.SpacerW4 import com.tangem.core.ui.components.marketprice.PriceChangeType import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemTypography import com.tangem.feature.wallet.impl.R import com.tangem.feature.wallet.presentation.common.state.TokenItemState import com.tangem.feature.wallet.presentation.common.state.TokenItemState.PriceChangeState as TokenPriceChangeState @@ -87,7 +86,7 @@ private fun PriceChangeText(type: PriceChangeType?, text: String?) { }, overflow = TextOverflow.Ellipsis, maxLines = 1, - style = TangemTypography.body2, + style = TangemTheme.typography.body2, ) } } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenTitle.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenTitle.kt index 85091af4f8..e5b3050a53 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenTitle.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/common/component/token/TokenTitle.kt @@ -15,7 +15,6 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.style.TextOverflow import com.tangem.core.ui.components.RectangleShimmer import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemTypography import com.tangem.feature.wallet.impl.R import com.tangem.feature.wallet.presentation.common.state.TokenItemState.TitleState as TokenTitleState @@ -63,7 +62,7 @@ private fun CurrencyNameText(name: String, modifier: Modifier = Modifier) { color = TangemTheme.colors.text.primary1, overflow = TextOverflow.Ellipsis, maxLines = 1, - style = TangemTypography.subtitle2, + style = TangemTheme.typography.subtitle2, ) } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletCard.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletCard.kt index 9af63cffb8..f0348827c3 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletCard.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/common/WalletCard.kt @@ -361,7 +361,7 @@ private fun AdditionalInfoText(text: TextReference) { color = TangemTheme.colors.text.tertiary, maxLines = 1, overflow = TextOverflow.Ellipsis, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/multicurrency/MultiCurrencyContent.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/multicurrency/MultiCurrencyContent.kt index 9bdaf10b43..287f84f8d9 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/multicurrency/MultiCurrencyContent.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/components/multicurrency/MultiCurrencyContent.kt @@ -82,7 +82,7 @@ private fun LazyListScope.nonContentItem(modifier: Modifier = Modifier) { modifier = Modifier.padding(horizontal = TangemTheme.dimens.spacing48), color = TangemTheme.colors.text.tertiary, textAlign = TextAlign.Center, - style = TangemTheme.typography.caption, + style = TangemTheme.typography.caption2, ) } }