Browse Source

Fix color of BigIcon according to Figma

pull/3719/head
Benoit Marty 1 week ago
parent
commit
e3b77ce219
  1. 6
      libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/BigIcon.kt
  2. 5
      libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ColorAliases.kt

6
libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/BigIcon.kt

@ -30,12 +30,12 @@ import io.element.android.compound.theme.ElementTheme
import io.element.android.compound.tokens.generated.CompoundIcons import io.element.android.compound.tokens.generated.CompoundIcons
import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.preview.PreviewsDayNight import io.element.android.libraries.designsystem.preview.PreviewsDayNight
import io.element.android.libraries.designsystem.theme.bigIconDefaultBackgroundColor
import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.ui.strings.CommonStrings import io.element.android.libraries.ui.strings.CommonStrings
/** /**
* Compound component that display a big icon centered in a rounded square. * Compound component that display a big icon centered in a rounded square.
* Figma: https://www.figma.com/design/G1xy0HDZKJf5TCRFmKb5d5/Compound-Android-Components?node-id=1960-553&node-type=frame&m=dev
*/ */
object BigIcon { object BigIcon {
/** /**
@ -84,7 +84,7 @@ object BigIcon {
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
val backgroundColor = when (style) { val backgroundColor = when (style) {
is Style.Default -> ElementTheme.colors.bigIconDefaultBackgroundColor is Style.Default -> ElementTheme.colors.bgSubtleSecondary
Style.Alert, Style.Success -> Color.Transparent Style.Alert, Style.Success -> Color.Transparent
Style.AlertSolid -> ElementTheme.colors.bgCriticalSubtle Style.AlertSolid -> ElementTheme.colors.bgCriticalSubtle
Style.SuccessSolid -> ElementTheme.colors.bgSuccessSubtle Style.SuccessSolid -> ElementTheme.colors.bgSuccessSubtle
@ -100,7 +100,7 @@ object BigIcon {
Style.Success, Style.SuccessSolid -> stringResource(CommonStrings.common_success) Style.Success, Style.SuccessSolid -> stringResource(CommonStrings.common_success)
} }
val iconTint = when (style) { val iconTint = when (style) {
is Style.Default -> ElementTheme.colors.iconSecondaryAlpha is Style.Default -> ElementTheme.colors.iconSecondary
Style.Alert, Style.AlertSolid -> ElementTheme.colors.iconCriticalPrimary Style.Alert, Style.AlertSolid -> ElementTheme.colors.iconCriticalPrimary
Style.Success, Style.SuccessSolid -> ElementTheme.colors.iconSuccessPrimary Style.Success, Style.SuccessSolid -> ElementTheme.colors.iconSuccessPrimary
} }

5
libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ColorAliases.kt

@ -132,10 +132,6 @@ val SemanticColors.mentionPillBackground
Color(0x26f4f7fa) Color(0x26f4f7fa)
} }
@OptIn(CoreColorToken::class)
val SemanticColors.bigIconDefaultBackgroundColor
get() = if (isLight) LightColorTokens.colorAlphaGray300 else DarkColorTokens.colorAlphaGray300
@OptIn(CoreColorToken::class) @OptIn(CoreColorToken::class)
val SemanticColors.bigCheckmarkBorderColor val SemanticColors.bigCheckmarkBorderColor
get() = if (isLight) LightColorTokens.colorGray400 else DarkColorTokens.colorGray400 get() = if (isLight) LightColorTokens.colorGray400 else DarkColorTokens.colorGray400
@ -195,7 +191,6 @@ internal fun ColorAliasesPreview() = ElementPreview {
"progressIndicatorTrackColor" to ElementTheme.colors.progressIndicatorTrackColor, "progressIndicatorTrackColor" to ElementTheme.colors.progressIndicatorTrackColor,
"temporaryColorBgSpecial" to ElementTheme.colors.temporaryColorBgSpecial, "temporaryColorBgSpecial" to ElementTheme.colors.temporaryColorBgSpecial,
"iconSuccessPrimaryBackground" to ElementTheme.colors.iconSuccessPrimaryBackground, "iconSuccessPrimaryBackground" to ElementTheme.colors.iconSuccessPrimaryBackground,
"bigIconBackgroundColor" to ElementTheme.colors.bigIconDefaultBackgroundColor,
"bigCheckmarkBorderColor" to ElementTheme.colors.bigCheckmarkBorderColor, "bigCheckmarkBorderColor" to ElementTheme.colors.bigCheckmarkBorderColor,
"highlightedMessageBackgroundColor" to ElementTheme.colors.highlightedMessageBackgroundColor, "highlightedMessageBackgroundColor" to ElementTheme.colors.highlightedMessageBackgroundColor,
) )

Loading…
Cancel
Save