Skip to content

Commit 784e751

Browse files
committed
Remove unused field BubbleState.isHighlighted
1 parent ec13e7f commit 784e751

File tree

8 files changed

+10
-47
lines changed

8 files changed

+10
-47
lines changed

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/ATimelineItemEventRow.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ internal fun ATimelineItemEventRow(
2121
timelineRoomInfo: TimelineRoomInfo = aTimelineRoomInfo(),
2222
renderReadReceipts: Boolean = false,
2323
isLastOutgoingMessage: Boolean = false,
24-
isHighlighted: Boolean = false,
2524
timelineProtectionState: TimelineProtectionState = aTimelineProtectionState(),
2625
) = TimelineItemEventRow(
2726
event = event,
2827
timelineRoomInfo = timelineRoomInfo,
2928
renderReadReceipts = renderReadReceipts,
3029
timelineProtectionState = timelineProtectionState,
3130
isLastOutgoingMessage = isLastOutgoingMessage,
32-
isHighlighted = isHighlighted,
3331
onEventClick = {},
3432
onLongClick = {},
3533
onLinkClick = {},

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageEventBubble.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ internal fun MessageEventBubblePreview(@PreviewParameter(BubbleStateProvider::cl
182182
contentAlignment = Alignment.Center,
183183
) {
184184
Text(
185-
text = "${state.groupPosition.javaClass.simpleName} m:${state.isMine.to01()} h:${state.isHighlighted.to01()}",
185+
text = "${state.groupPosition.javaClass.simpleName} isMine:${state.isMine.to01()}",
186186
style = ElementTheme.typography.fontBodyXsRegular,
187187
)
188188
}

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessageStateEventContainer.kt

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ package io.element.android.features.messages.impl.timeline.components
99

1010
import androidx.compose.foundation.combinedClickable
1111
import androidx.compose.foundation.interaction.MutableInteractionSource
12-
import androidx.compose.foundation.layout.Column
13-
import androidx.compose.foundation.layout.Spacer
14-
import androidx.compose.foundation.layout.size
1512
import androidx.compose.foundation.layout.widthIn
1613
import androidx.compose.foundation.shape.RoundedCornerShape
1714
import androidx.compose.material3.ripple
@@ -29,14 +26,12 @@ private val CORNER_RADIUS = 8.dp
2926

3027
@Composable
3128
fun MessageStateEventContainer(
32-
@Suppress("UNUSED_PARAMETER") isHighlighted: Boolean,
3329
interactionSource: MutableInteractionSource,
3430
onClick: () -> Unit,
3531
onLongClick: () -> Unit,
3632
modifier: Modifier = Modifier,
3733
content: @Composable () -> Unit = {},
3834
) {
39-
// Ignore isHighlighted for now, we need a design decision on it.
4035
val backgroundColor = Color.Transparent
4136
val shape = RoundedCornerShape(CORNER_RADIUS)
4237
Surface(
@@ -58,22 +53,9 @@ fun MessageStateEventContainer(
5853
@PreviewsDayNight
5954
@Composable
6055
internal fun MessageStateEventContainerPreview() = ElementPreview {
61-
Column {
62-
MessageStateEventContainer(
63-
isHighlighted = false,
64-
interactionSource = remember { MutableInteractionSource() },
65-
onClick = {},
66-
onLongClick = {},
67-
) {
68-
Spacer(modifier = Modifier.size(width = 120.dp, height = 32.dp))
69-
}
70-
MessageStateEventContainer(
71-
isHighlighted = true,
72-
interactionSource = remember { MutableInteractionSource() },
73-
onClick = {},
74-
onLongClick = {},
75-
) {
76-
Spacer(modifier = Modifier.size(width = 120.dp, height = 32.dp))
77-
}
78-
}
56+
MessageStateEventContainer(
57+
interactionSource = remember { MutableInteractionSource() },
58+
onClick = {},
59+
onLongClick = {},
60+
)
7961
}

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRow.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ fun TimelineItemEventRow(
119119
timelineProtectionState: TimelineProtectionState,
120120
renderReadReceipts: Boolean,
121121
isLastOutgoingMessage: Boolean,
122-
isHighlighted: Boolean,
123122
onEventClick: () -> Unit,
124123
onLongClick: () -> Unit,
125124
onLinkClick: (Link) -> Unit,
@@ -195,7 +194,6 @@ fun TimelineItemEventRow(
195194
TimelineItemEventRowContent(
196195
event = event,
197196
timelineProtectionState = timelineProtectionState,
198-
isHighlighted = isHighlighted,
199197
timelineRoomInfo = timelineRoomInfo,
200198
interactionSource = interactionSource,
201199
onContentClick = onContentClick,
@@ -229,7 +227,6 @@ fun TimelineItemEventRow(
229227
TimelineItemEventRowContent(
230228
event = event,
231229
timelineProtectionState = timelineProtectionState,
232-
isHighlighted = isHighlighted,
233230
timelineRoomInfo = timelineRoomInfo,
234231
interactionSource = interactionSource,
235232
onContentClick = onContentClick,
@@ -284,7 +281,6 @@ private fun SwipeSensitivity(
284281
private fun TimelineItemEventRowContent(
285282
event: TimelineItem.Event,
286283
timelineProtectionState: TimelineProtectionState,
287-
isHighlighted: Boolean,
288284
timelineRoomInfo: TimelineRoomInfo,
289285
interactionSource: MutableInteractionSource,
290286
onContentClick: () -> Unit,
@@ -338,7 +334,6 @@ private fun TimelineItemEventRowContent(
338334
val bubbleState = BubbleState(
339335
groupPosition = event.groupPosition,
340336
isMine = event.isMine,
341-
isHighlighted = isHighlighted,
342337
timelineRoomInfo = timelineRoomInfo,
343338
)
344339
MessageEventBubble(

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ internal fun TimelineItemRow(
111111
event = timelineItem,
112112
renderReadReceipts = renderReadReceipts,
113113
isLastOutgoingMessage = isLastOutgoingMessage,
114-
isHighlighted = timelineItem.isEvent(focusedEventId),
115114
onClick = { onContentClick(timelineItem) },
116115
onReadReceiptsClick = onReadReceiptClick,
117116
onLongClick = { onLongClick(timelineItem) },
@@ -155,7 +154,6 @@ internal fun TimelineItemRow(
155154
renderReadReceipts = renderReadReceipts,
156155
timelineProtectionState = timelineProtectionState,
157156
isLastOutgoingMessage = isLastOutgoingMessage,
158-
isHighlighted = timelineItem.isEvent(focusedEventId),
159157
onEventClick = { onContentClick(timelineItem) },
160158
onLongClick = { onLongClick(timelineItem) },
161159
onLinkClick = onLinkClick,

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemStateEventRow.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ fun TimelineItemStateEventRow(
4040
event: TimelineItem.Event,
4141
renderReadReceipts: Boolean,
4242
isLastOutgoingMessage: Boolean,
43-
isHighlighted: Boolean,
4443
onClick: () -> Unit,
4544
onLongClick: () -> Unit,
4645
onReadReceiptsClick: (event: TimelineItem.Event) -> Unit,
@@ -60,7 +59,6 @@ fun TimelineItemStateEventRow(
6059
contentAlignment = Alignment.Center
6160
) {
6261
MessageStateEventContainer(
63-
isHighlighted = isHighlighted,
6462
interactionSource = interactionSource,
6563
onClick = onClick,
6664
onLongClick = onLongClick,
@@ -107,7 +105,6 @@ internal fun TimelineItemStateEventRowPreview() = ElementPreview {
107105
),
108106
renderReadReceipts = true,
109107
isLastOutgoingMessage = false,
110-
isHighlighted = false,
111108
onClick = {},
112109
onLongClick = {},
113110
onReadReceiptsClick = {},

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleState.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import io.element.android.features.messages.impl.timeline.model.TimelineItemGrou
1313
data class BubbleState(
1414
val groupPosition: TimelineItemGroupPosition,
1515
val isMine: Boolean,
16-
val isHighlighted: Boolean,
1716
val timelineRoomInfo: TimelineRoomInfo,
1817
) {
1918
/** True to cut out the top start corner of the bubble, to give margin for the sender avatar. */

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/bubble/BubbleStateProvider.kt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,21 @@ open class BubbleStateProvider : PreviewParameterProvider<BubbleState> {
2121
TimelineItemGroupPosition.None,
2222
).map { groupPosition ->
2323
sequenceOf(false, true).map { isMine ->
24-
sequenceOf(false, true).map { isHighlighted ->
25-
aBubbleState(
26-
groupPosition = groupPosition,
27-
isMine = isMine,
28-
isHighlighted = isHighlighted,
29-
)
30-
}
24+
aBubbleState(
25+
groupPosition = groupPosition,
26+
isMine = isMine,
27+
)
3128
}
32-
.flatten()
3329
}
3430
.flatten()
3531
}
3632

3733
internal fun aBubbleState(
3834
groupPosition: TimelineItemGroupPosition = TimelineItemGroupPosition.First,
3935
isMine: Boolean = false,
40-
isHighlighted: Boolean = false,
4136
timelineRoomInfo: TimelineRoomInfo = aTimelineRoomInfo(),
4237
) = BubbleState(
4338
groupPosition = groupPosition,
4439
isMine = isMine,
45-
isHighlighted = isHighlighted,
4640
timelineRoomInfo = timelineRoomInfo,
4741
)

0 commit comments

Comments
 (0)