From cb501f3b5f0186ac046b84f6e114a25b7bd60db9 Mon Sep 17 00:00:00 2001 From: ganfra Date: Mon, 5 Oct 2026 20:48:24 +0200 Subject: [PATCH] Fix the Detekt issues on the timeline selection code --- .../messages/impl/timeline/components/TimelineItemRow.kt | 2 +- .../impl/timeline/model/TimelineItemSelectionData.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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 32cef08ea7..bc19f239cc 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 @@ -194,7 +194,7 @@ internal fun TimelineItemRow( layout(width = width, height = height) { contentPlaceable.place(0, 0) if (indicatorPlaceable != null) { - val bubbleCenter = contentPlaceable[BubbleVerticalCenter].takeIf { it != AlignmentLine.Unspecified } ?: (height / 2) + val bubbleCenter = contentPlaceable[BubbleVerticalCenter].takeIf { it != AlignmentLine.Unspecified } ?: height / 2 val x = if (layoutDirection == LayoutDirection.Ltr) 0 else width - indicatorPlaceable.width indicatorPlaceable.place(x = x, y = bubbleCenter - indicatorPlaceable.height / 2) } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/TimelineItemSelectionData.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/TimelineItemSelectionData.kt index 60a30d5c73..eab6a2523f 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/TimelineItemSelectionData.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/TimelineItemSelectionData.kt @@ -12,12 +12,12 @@ package io.element.android.features.messages.impl.timeline.model * * @param isSelectionModeActive whether the timeline is currently in selection mode. Drives * behaviour (e.g. the whole-row click target) and must reflect the real mode, not [progress]. - * @param progress animated 0f..1f value driving the visuals (content slide + indicator slide-in). - * Animated once in TimelineView and shared by every row. Differs from [isSelectionModeActive] - * during the enter/exit animation. * @param isSelected whether this specific row's event is part of the current selection. * @param canBeSelected whether this specific row's event can be selected for the action selection mode was entered for. * Rows which cannot be selected render no indicator, and their content does not slide. + * @param progress animated 0f..1f value driving the visuals (content slide + indicator slide-in). + * Animated once in TimelineView and shared by every row. Differs from [isSelectionModeActive] + * during the enter/exit animation. */ data class TimelineItemSelectionData( val isSelectionModeActive: Boolean = false,