Updated on 2026-08-14
This commit is contained in:
parent
799d797fb5
commit
50a384f13d
16 changed files with 61 additions and 78 deletions
|
|
@ -37,8 +37,6 @@ enum class AccountIconSize {
|
|||
Medium,
|
||||
Small,
|
||||
ExtraSmall,
|
||||
RedesignedDefault,
|
||||
RedesignExtraSmall,
|
||||
ContactLarge,
|
||||
ContactDefault,
|
||||
}
|
||||
|
|
@ -133,13 +131,11 @@ fun AccountCharIcon(char: Char, color: Color, size: AccountIconSize, modifier: M
|
|||
animationSpec = animation(),
|
||||
)
|
||||
val textStyle = when (size) {
|
||||
AccountIconSize.Default -> TangemTheme.typography.h3
|
||||
AccountIconSize.Default -> TangemTheme.typography2.headingSemibold28
|
||||
AccountIconSize.Large -> TangemTheme.typography.h1
|
||||
AccountIconSize.Medium -> TangemTheme.typography.subtitle1
|
||||
AccountIconSize.Small -> TangemTheme.typography.subtitle2
|
||||
AccountIconSize.ExtraSmall -> TangemTheme.typography.caption1
|
||||
AccountIconSize.RedesignedDefault -> TangemTheme.typography2.headingSemibold28
|
||||
AccountIconSize.RedesignExtraSmall -> TangemTheme.typography2.captionMedium11
|
||||
AccountIconSize.ExtraSmall -> TangemTheme.typography2.captionMedium11
|
||||
AccountIconSize.ContactLarge -> TangemTheme.typography3.heading.medium
|
||||
AccountIconSize.ContactDefault -> TangemTheme.typography3.body.medium
|
||||
}
|
||||
|
|
@ -174,32 +170,26 @@ private fun AccountIconSize.iconSizeInDp(): Dp = when (this) {
|
|||
AccountIconSize.Medium -> 16.dp
|
||||
AccountIconSize.Small -> 12.dp
|
||||
AccountIconSize.ExtraSmall -> 8.dp
|
||||
AccountIconSize.RedesignedDefault -> 20.dp
|
||||
AccountIconSize.RedesignExtraSmall -> 8.dp
|
||||
AccountIconSize.ContactLarge -> 32.dp
|
||||
AccountIconSize.ContactDefault -> 20.dp
|
||||
}
|
||||
|
||||
fun AccountIconSize.toBoxSize(): Dp = when (this) {
|
||||
AccountIconSize.Default -> 36.dp
|
||||
AccountIconSize.Default -> 40.dp
|
||||
AccountIconSize.Large -> 88.dp
|
||||
AccountIconSize.Medium -> 28.dp
|
||||
AccountIconSize.Small -> 20.dp
|
||||
AccountIconSize.ExtraSmall -> 14.dp
|
||||
AccountIconSize.RedesignedDefault -> 40.dp
|
||||
AccountIconSize.RedesignExtraSmall -> 16.dp
|
||||
AccountIconSize.ExtraSmall -> 16.dp
|
||||
AccountIconSize.ContactLarge -> 80.dp
|
||||
AccountIconSize.ContactDefault -> 40.dp
|
||||
}
|
||||
|
||||
private fun AccountIconSize.boxShapeSizeInDp(): Dp = when (this) {
|
||||
AccountIconSize.Default -> 10.dp
|
||||
AccountIconSize.Default -> 12.dp
|
||||
AccountIconSize.Large -> 24.dp
|
||||
AccountIconSize.Medium -> 8.dp
|
||||
AccountIconSize.Small -> 6.dp
|
||||
AccountIconSize.ExtraSmall -> 4.dp
|
||||
AccountIconSize.RedesignedDefault -> 12.dp
|
||||
AccountIconSize.RedesignExtraSmall -> 6.dp
|
||||
AccountIconSize.ExtraSmall -> 6.dp
|
||||
AccountIconSize.ContactLarge -> 80.dp
|
||||
AccountIconSize.ContactDefault -> 100.dp
|
||||
}
|
||||
|
|
@ -242,9 +232,7 @@ private fun Sample() {
|
|||
AccountIconSize.Large -> AccountIconSize.Medium
|
||||
AccountIconSize.Medium -> AccountIconSize.Small
|
||||
AccountIconSize.Small -> AccountIconSize.ExtraSmall
|
||||
AccountIconSize.ExtraSmall -> AccountIconSize.RedesignedDefault
|
||||
AccountIconSize.RedesignedDefault -> AccountIconSize.RedesignExtraSmall
|
||||
AccountIconSize.RedesignExtraSmall -> AccountIconSize.ContactLarge
|
||||
AccountIconSize.ExtraSmall -> AccountIconSize.ContactLarge
|
||||
AccountIconSize.ContactLarge -> AccountIconSize.ContactDefault
|
||||
AccountIconSize.ContactDefault -> AccountIconSize.Default
|
||||
}
|
||||
|
|
@ -264,6 +252,5 @@ private fun Sample() {
|
|||
AccountCharIcon(char = 'M', color = Color.Magenta, size = AccountIconSize.Medium)
|
||||
AccountCharIcon(char = 'S', color = Color.DarkGray, size = AccountIconSize.Small)
|
||||
AccountCharIcon(char = 'E', color = Color.Green, size = AccountIconSize.ExtraSmall)
|
||||
AccountCharIcon(char = 'D', color = Color.LightGray, size = AccountIconSize.RedesignExtraSmall)
|
||||
}
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ fun TangemCurrencyIcon(state: CurrencyIconState, modifier: Modifier = Modifier,
|
|||
modifier = iconModifier,
|
||||
shouldShowTopBadge = shouldDisplayNetwork,
|
||||
networkBadgeSize = 14.dp,
|
||||
networkBadgeBackground = TangemTheme.colors2.surface.level1,
|
||||
networkBadgeBackground = TangemTheme.colors3.bg.secondary,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ fun CurrencyIcon(
|
|||
modifier: Modifier = Modifier,
|
||||
shouldDisplayNetwork: Boolean = true,
|
||||
networkBadgeSize: Dp = 14.dp,
|
||||
networkBadgeBackground: Color = TangemTheme.colors.background.primary,
|
||||
networkBadgeBackground: Color = TangemTheme.colors3.bg.secondary,
|
||||
withFixedSize: Boolean = true,
|
||||
iconSize: Dp = 36.dp,
|
||||
) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue