diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/ATimelineItemEventRow.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/ATimelineItemEventRow.kt index 4bcf8df61c..8434242abd 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/ATimelineItemEventRow.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/ATimelineItemEventRow.kt @@ -21,7 +21,6 @@ internal fun ATimelineItemEventRow( timelineRoomInfo: TimelineRoomInfo = aTimelineRoomInfo(), renderReadReceipts: Boolean = false, isLastOutgoingMessage: Boolean = false, - isHighlighted: Boolean = false, timelineProtectionState: TimelineProtectionState = aTimelineProtectionState(), ) = TimelineItemEventRow( event = event, @@ -29,7 +28,6 @@ internal fun ATimelineItemEventRow( renderReadReceipts = renderReadReceipts, timelineProtectionState = timelineProtectionState, isLastOutgoingMessage = isLastOutgoingMessage, - isHighlighted = isHighlighted, onEventClick = {}, onLongClick = {}, onLinkClick = {}, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageEventBubble.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageEventBubble.kt index f1c1ee1e2a..c8bae78f13 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageEventBubble.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageEventBubble.kt @@ -182,7 +182,7 @@ internal fun MessageEventBubblePreview(@PreviewParameter(BubbleStateProvider::cl contentAlignment = Alignment.Center, ) { Text( - text = "${state.groupPosition.javaClass.simpleName} m:${state.isMine.to01()} h:${state.isHighlighted.to01()}", + text = "${state.groupPosition.javaClass.simpleName} isMine:${state.isMine.to01()}", style = ElementTheme.typography.fontBodyXsRegular, ) } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageStateEventContainer.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageStateEventContainer.kt index 1ed9be66c4..ac9be4de74 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageStateEventContainer.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageStateEventContainer.kt @@ -9,9 +9,6 @@ package io.element.android.features.messages.impl.timeline.components import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.interaction.MutableInteractionSource -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.ripple @@ -29,14 +26,12 @@ private val CORNER_RADIUS = 8.dp @Composable fun MessageStateEventContainer( - @Suppress("UNUSED_PARAMETER") isHighlighted: Boolean, interactionSource: MutableInteractionSource, onClick: () -> Unit, onLongClick: () -> Unit, modifier: Modifier = Modifier, content: @Composable () -> Unit = {}, ) { - // Ignore isHighlighted for now, we need a design decision on it. val backgroundColor = Color.Transparent val shape = RoundedCornerShape(CORNER_RADIUS) Surface( @@ -58,22 +53,9 @@ fun MessageStateEventContainer( @PreviewsDayNight @Composable internal fun MessageStateEventContainerPreview() = ElementPreview { - Column { - MessageStateEventContainer( - isHighlighted = false, - interactionSource = remember { MutableInteractionSource() }, - onClick = {}, - onLongClick = {}, - ) { - Spacer(modifier = Modifier.size(width = 120.dp, height = 32.dp)) - } - MessageStateEventContainer( - isHighlighted = true, - interactionSource = remember { MutableInteractionSource() }, - onClick = {}, - onLongClick = {}, - ) { - Spacer(modifier = Modifier.size(width = 120.dp, height = 32.dp)) - } - } + MessageStateEventContainer( + interactionSource = remember { MutableInteractionSource() }, + onClick = {}, + onLongClick = {}, + ) } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt index 84026cd215..18d0658dd6 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt @@ -119,7 +119,6 @@ fun TimelineItemEventRow( timelineProtectionState: TimelineProtectionState, renderReadReceipts: Boolean, isLastOutgoingMessage: Boolean, - isHighlighted: Boolean, onEventClick: () -> Unit, onLongClick: () -> Unit, onLinkClick: (Link) -> Unit, @@ -195,7 +194,6 @@ fun TimelineItemEventRow( TimelineItemEventRowContent( event = event, timelineProtectionState = timelineProtectionState, - isHighlighted = isHighlighted, timelineRoomInfo = timelineRoomInfo, interactionSource = interactionSource, onContentClick = onContentClick, @@ -229,7 +227,6 @@ fun TimelineItemEventRow( TimelineItemEventRowContent( event = event, timelineProtectionState = timelineProtectionState, - isHighlighted = isHighlighted, timelineRoomInfo = timelineRoomInfo, interactionSource = interactionSource, onContentClick = onContentClick, @@ -284,7 +281,6 @@ private fun SwipeSensitivity( private fun TimelineItemEventRowContent( event: TimelineItem.Event, timelineProtectionState: TimelineProtectionState, - isHighlighted: Boolean, timelineRoomInfo: TimelineRoomInfo, interactionSource: MutableInteractionSource, onContentClick: () -> Unit, @@ -338,7 +334,6 @@ private fun TimelineItemEventRowContent( val bubbleState = BubbleState( groupPosition = event.groupPosition, isMine = event.isMine, - isHighlighted = isHighlighted, timelineRoomInfo = timelineRoomInfo, ) MessageEventBubble( diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt index b0cd404c11..30cb8c5006 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt @@ -111,7 +111,6 @@ internal fun TimelineItemRow( event = timelineItem, renderReadReceipts = renderReadReceipts, isLastOutgoingMessage = isLastOutgoingMessage, - isHighlighted = timelineItem.isEvent(focusedEventId), onClick = { onContentClick(timelineItem) }, onReadReceiptsClick = onReadReceiptClick, onLongClick = { onLongClick(timelineItem) }, @@ -155,7 +154,6 @@ internal fun TimelineItemRow( renderReadReceipts = renderReadReceipts, timelineProtectionState = timelineProtectionState, isLastOutgoingMessage = isLastOutgoingMessage, - isHighlighted = timelineItem.isEvent(focusedEventId), onEventClick = { onContentClick(timelineItem) }, onLongClick = { onLongClick(timelineItem) }, onLinkClick = onLinkClick, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemStateEventRow.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemStateEventRow.kt index 6bd0e24908..2f66d586a9 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemStateEventRow.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemStateEventRow.kt @@ -40,7 +40,6 @@ fun TimelineItemStateEventRow( event: TimelineItem.Event, renderReadReceipts: Boolean, isLastOutgoingMessage: Boolean, - isHighlighted: Boolean, onClick: () -> Unit, onLongClick: () -> Unit, onReadReceiptsClick: (event: TimelineItem.Event) -> Unit, @@ -60,7 +59,6 @@ fun TimelineItemStateEventRow( contentAlignment = Alignment.Center ) { MessageStateEventContainer( - isHighlighted = isHighlighted, interactionSource = interactionSource, onClick = onClick, onLongClick = onLongClick, @@ -107,7 +105,6 @@ internal fun TimelineItemStateEventRowPreview() = ElementPreview { ), renderReadReceipts = true, isLastOutgoingMessage = false, - isHighlighted = false, onClick = {}, onLongClick = {}, onReadReceiptsClick = {}, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleState.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleState.kt index 07219f4281..81aa459413 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleState.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleState.kt @@ -13,7 +13,6 @@ import io.element.android.features.messages.impl.timeline.model.TimelineItemGrou data class BubbleState( val groupPosition: TimelineItemGroupPosition, val isMine: Boolean, - val isHighlighted: Boolean, val timelineRoomInfo: TimelineRoomInfo, ) { /** True to cut out the top start corner of the bubble, to give margin for the sender avatar. */ diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleStateProvider.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleStateProvider.kt index 97b69b1f64..02a6e19504 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleStateProvider.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleStateProvider.kt @@ -21,15 +21,11 @@ open class BubbleStateProvider : PreviewParameterProvider { TimelineItemGroupPosition.None, ).map { groupPosition -> sequenceOf(false, true).map { isMine -> - sequenceOf(false, true).map { isHighlighted -> - aBubbleState( - groupPosition = groupPosition, - isMine = isMine, - isHighlighted = isHighlighted, - ) - } + aBubbleState( + groupPosition = groupPosition, + isMine = isMine, + ) } - .flatten() } .flatten() } @@ -37,11 +33,9 @@ open class BubbleStateProvider : PreviewParameterProvider { internal fun aBubbleState( groupPosition: TimelineItemGroupPosition = TimelineItemGroupPosition.First, isMine: Boolean = false, - isHighlighted: Boolean = false, timelineRoomInfo: TimelineRoomInfo = aTimelineRoomInfo(), ) = BubbleState( groupPosition = groupPosition, isMine = isMine, - isHighlighted = isHighlighted, timelineRoomInfo = timelineRoomInfo, )