Browse Source

Fix regression on some colors. Introduce a temporary color, since the color values are not in Compound. `temporaryColorBgSpecial`

pull/840/head
Benoit Marty 1 year ago committed by Benoit Marty
parent
commit
88eaab0e44
  1. 3
      features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt
  2. 3
      libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RoundedIconAtom.kt
  3. 5
      libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ColorAliases.kt
  4. 3
      libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnsavedAvatar.kt

3
features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt

@ -56,6 +56,7 @@ import io.element.android.libraries.designsystem.theme.components.Button @@ -56,6 +56,7 @@ import io.element.android.libraries.designsystem.theme.components.Button
import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.designsystem.theme.components.Text
import io.element.android.libraries.designsystem.theme.components.TextButton
import io.element.android.libraries.designsystem.theme.temporaryColorBgSpecial
import io.element.android.libraries.designsystem.utils.LogCompositions
import io.element.android.libraries.theme.ElementTheme
import io.element.android.libraries.ui.strings.CommonStrings
@ -159,7 +160,7 @@ private fun AnalyticsOptInContentRow( @@ -159,7 +160,7 @@ private fun AnalyticsOptInContentRow(
modifier = modifier
.fillMaxWidth()
.background(
color = ElementTheme.materialColors.surfaceVariant,
color = ElementTheme.colors.temporaryColorBgSpecial,
shape = bgShape,
)
.padding(vertical = 12.dp, horizontal = 20.dp),

3
libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RoundedIconAtom.kt

@ -36,6 +36,7 @@ import androidx.compose.ui.unit.dp @@ -36,6 +36,7 @@ import androidx.compose.ui.unit.dp
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.designsystem.theme.temporaryColorBgSpecial
import io.element.android.libraries.theme.ElementTheme
/**
@ -59,7 +60,7 @@ fun RoundedIconAtom( @@ -59,7 +60,7 @@ fun RoundedIconAtom(
modifier = modifier
.size(size.toContainerSize())
.background(
color = ElementTheme.materialColors.surfaceVariant,
color = ElementTheme.colors.temporaryColorBgSpecial,
shape = RoundedCornerShape(size.toCornerSize())
)
) {

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

@ -65,6 +65,10 @@ val SemanticColors.messageFromOtherBackground @@ -65,6 +65,10 @@ val SemanticColors.messageFromOtherBackground
Color(0xFF26282D)
}
// Temporary color, which is not in the token right now
val SemanticColors.temporaryColorBgSpecial
get() = if (isLight) Color(0xFFE4E8F0) else Color(0xFF3A4048)
@Preview
@Composable
internal fun ColorAliasesLightPreview() = ElementPreviewLight { ContentToPreview() }
@ -86,6 +90,7 @@ private fun ContentToPreview() { @@ -86,6 +90,7 @@ private fun ContentToPreview() {
"placeholderBackground" to ElementTheme.colors.placeholderBackground,
"messageFromMeBackground" to ElementTheme.colors.messageFromMeBackground,
"messageFromOtherBackground" to ElementTheme.colors.messageFromOtherBackground,
"temporaryColorBgSpecial" to ElementTheme.colors.temporaryColorBgSpecial,
)
)
}

3
libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnsavedAvatar.kt

@ -40,6 +40,7 @@ import io.element.android.libraries.designsystem.preview.ElementPreviewDark @@ -40,6 +40,7 @@ import io.element.android.libraries.designsystem.preview.ElementPreviewDark
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
import io.element.android.libraries.designsystem.preview.debugPlaceholderBackground
import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.designsystem.theme.temporaryColorBgSpecial
import io.element.android.libraries.theme.ElementTheme
/**
@ -69,7 +70,7 @@ fun UnsavedAvatar( @@ -69,7 +70,7 @@ fun UnsavedAvatar(
contentDescription = null,
)
} else {
Box(modifier = commonModifier.background(ElementTheme.materialColors.surfaceVariant)) {
Box(modifier = commonModifier.background(ElementTheme.colors.temporaryColorBgSpecial)) {
Icon(
imageVector = Icons.Outlined.AddAPhoto,
contentDescription = "",

Loading…
Cancel
Save