Ignore isHighlighted state for now, we need a design decision on it.

This commit is contained in:
Benoit Marty
2023-06-29 11:35:53 +02:00
committed by Benoit Marty
parent 8cb0e0808c
commit 5135c132d9
4 changed files with 10 additions and 28 deletions
@@ -97,14 +97,11 @@ fun MessageEventBubble(
} }
} }
val backgroundBubbleColor = if (state.isHighlighted) { // Ignore state.isHighlighted for now, we need a design decision on it.
ElementTheme.legacyColors.messageHighlightedBackground val backgroundBubbleColor = if (state.isMine) {
ElementTheme.legacyColors.messageFromMeBackground
} else { } else {
if (state.isMine) { ElementTheme.legacyColors.messageFromOtherBackground
ElementTheme.legacyColors.messageFromMeBackground
} else {
ElementTheme.legacyColors.messageFromOtherBackground
}
} }
val bubbleShape = bubbleShape() val bubbleShape = bubbleShape()
Box( Box(
@@ -41,18 +41,15 @@ private val CORNER_RADIUS = 8.dp
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
fun MessageStateEventContainer( fun MessageStateEventContainer(
isHighlighted: Boolean, @Suppress("UNUSED_PARAMETER") isHighlighted: Boolean,
interactionSource: MutableInteractionSource, interactionSource: MutableInteractionSource,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
onClick: () -> Unit = {}, onClick: () -> Unit = {},
onLongClick: () -> Unit = {}, onLongClick: () -> Unit = {},
content: @Composable () -> Unit = {}, content: @Composable () -> Unit = {},
) { ) {
val backgroundColor = if (isHighlighted) { // Ignore isHighlighted for now, we need a design decision on it.
ElementTheme.legacyColors.messageHighlightedBackground val backgroundColor = Color.Transparent
} else {
Color.Companion.Transparent
}
val shape = RoundedCornerShape(CORNER_RADIUS) val shape = RoundedCornerShape(CORNER_RADIUS)
Surface( Surface(
modifier = modifier modifier = modifier
@@ -38,7 +38,6 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewDark
import io.element.android.libraries.designsystem.preview.ElementPreviewLight import io.element.android.libraries.designsystem.preview.ElementPreviewLight
import io.element.android.libraries.theme.ElementTheme
import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.designsystem.theme.components.Surface import io.element.android.libraries.designsystem.theme.components.Surface
import io.element.android.libraries.designsystem.theme.components.Text import io.element.android.libraries.designsystem.theme.components.Text
@@ -49,15 +48,12 @@ private val CORNER_RADIUS = 8.dp
fun GroupHeaderView( fun GroupHeaderView(
text: String, text: String,
isExpanded: Boolean, isExpanded: Boolean,
isHighlighted: Boolean, @Suppress("UNUSED_PARAMETER") isHighlighted: Boolean,
onClick: () -> Unit, onClick: () -> Unit,
modifier: Modifier = Modifier modifier: Modifier = Modifier
) { ) {
val backgroundColor = if (isHighlighted) { // Ignore isHighlighted for now, we need a design decision on it.
ElementTheme.legacyColors.messageHighlightedBackground val backgroundColor = Color.Companion.Transparent
} else {
Color.Companion.Transparent
}
val shape = RoundedCornerShape(CORNER_RADIUS) val shape = RoundedCornerShape(CORNER_RADIUS)
Box( Box(
@@ -39,7 +39,6 @@ import io.element.android.libraries.theme.compound.generated.SemanticColors
class ElementColors( class ElementColors(
messageFromMeBackground: Color, messageFromMeBackground: Color,
messageFromOtherBackground: Color, messageFromOtherBackground: Color,
messageHighlightedBackground: Color,
quaternary: Color, quaternary: Color,
quinary: Color, quinary: Color,
gray300: Color, gray300: Color,
@@ -51,8 +50,6 @@ class ElementColors(
private set private set
var messageFromOtherBackground by mutableStateOf(messageFromOtherBackground) var messageFromOtherBackground by mutableStateOf(messageFromOtherBackground)
private set private set
var messageHighlightedBackground by mutableStateOf(messageHighlightedBackground)
private set
var quaternary by mutableStateOf(quaternary) var quaternary by mutableStateOf(quaternary)
private set private set
@@ -75,7 +72,6 @@ class ElementColors(
fun copy( fun copy(
messageFromMeBackground: Color = this.messageFromMeBackground, messageFromMeBackground: Color = this.messageFromMeBackground,
messageFromOtherBackground: Color = this.messageFromOtherBackground, messageFromOtherBackground: Color = this.messageFromOtherBackground,
messageHighlightedBackground: Color = this.messageHighlightedBackground,
quaternary: Color = this.quaternary, quaternary: Color = this.quaternary,
quinary: Color = this.quinary, quinary: Color = this.quinary,
gray300: Color = this.gray300, gray300: Color = this.gray300,
@@ -85,7 +81,6 @@ class ElementColors(
) = ElementColors( ) = ElementColors(
messageFromMeBackground = messageFromMeBackground, messageFromMeBackground = messageFromMeBackground,
messageFromOtherBackground = messageFromOtherBackground, messageFromOtherBackground = messageFromOtherBackground,
messageHighlightedBackground = messageHighlightedBackground,
quaternary = quaternary, quaternary = quaternary,
quinary = quinary, quinary = quinary,
gray300 = gray300, gray300 = gray300,
@@ -97,7 +92,6 @@ class ElementColors(
fun updateColorsFrom(other: ElementColors) { fun updateColorsFrom(other: ElementColors) {
messageFromMeBackground = other.messageFromMeBackground messageFromMeBackground = other.messageFromMeBackground
messageFromOtherBackground = other.messageFromOtherBackground messageFromOtherBackground = other.messageFromOtherBackground
messageHighlightedBackground = other.messageHighlightedBackground
quaternary = other.quaternary quaternary = other.quaternary
quinary = other.quinary quinary = other.quinary
gray300 = other.gray300 gray300 = other.gray300
@@ -110,7 +104,6 @@ class ElementColors(
internal fun elementColorsLight() = ElementColors( internal fun elementColorsLight() = ElementColors(
messageFromMeBackground = SystemGrey5Light, messageFromMeBackground = SystemGrey5Light,
messageFromOtherBackground = SystemGrey6Light, messageFromOtherBackground = SystemGrey6Light,
messageHighlightedBackground = Azure,
quaternary = Gray_100, quaternary = Gray_100,
quinary = Gray_50, quinary = Gray_50,
gray300 = LightDesignTokens.colorGray300, gray300 = LightDesignTokens.colorGray300,
@@ -122,7 +115,6 @@ internal fun elementColorsLight() = ElementColors(
internal fun elementColorsDark() = ElementColors( internal fun elementColorsDark() = ElementColors(
messageFromMeBackground = SystemGrey5Dark, messageFromMeBackground = SystemGrey5Dark,
messageFromOtherBackground = SystemGrey6Dark, messageFromOtherBackground = SystemGrey6Dark,
messageHighlightedBackground = Azure,
quaternary = Gray_400, quaternary = Gray_400,
quinary = Gray_450, quinary = Gray_450,
gray300 = DarkDesignTokens.colorGray300, gray300 = DarkDesignTokens.colorGray300,