diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt index 7e8bfbdc3f..78dd6c2e82 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt @@ -133,6 +133,7 @@ class AttachmentsPreviewPresenter( // If the media optimization selector is not displayed, we can pre-process the media // to prepare it for sending. This is done to avoid blocking the UI thread when the // user clicks on the send button. + @Suppress("ComplexCondition") if (mediaOptimizationSelectorState.displayMediaSelectorViews == false && preprocessMediaJob == null && imageEditorState == null && diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewStateProvider.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewStateProvider.kt index ced90550c3..a2df440a12 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewStateProvider.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewStateProvider.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.core.net.toUri import io.element.android.features.messages.impl.attachments.Attachment import io.element.android.features.messages.impl.attachments.preview.imageeditor.AttachmentImageEditorState -import io.element.android.features.messages.impl.attachments.preview.imageeditor.AttachmentImageEdits +import io.element.android.features.messages.impl.attachments.preview.imageeditor.anAttachmentImageEditorState import io.element.android.features.messages.impl.attachments.video.MediaOptimizationSelectorState import io.element.android.features.messages.impl.attachments.video.VideoUploadEstimation import io.element.android.libraries.architecture.AsyncData @@ -45,7 +45,7 @@ open class AttachmentsPreviewStateProvider : PreviewParameterProvider Unit, ) { var dragTarget by remember { mutableStateOf(null) } val latestCropRect by rememberUpdatedState(cropRect) val borderColor = ElementTheme.colors.iconPrimary val guideColor = ElementTheme.colors.iconPrimary - val drawGuidelines = dragTarget == CropDragTarget.Move + val drawGuidelines = dragTarget == CropDragTarget.Move || forceDrawGuidelines Canvas( modifier = Modifier .fillMaxSize() @@ -352,11 +354,11 @@ private fun CropOverlay( size = Size(width = cropRight - cropLeft, height = cropBottom - cropTop), style = Stroke(width = 1.dp.toPx()), ) - // Guide lines dividing the crop area into 9 equal parts + // Guidelines dividing the crop area into 9 equal parts if (drawGuidelines) { val thirdWidth = (cropRight - cropLeft) / 3f val thirdHeight = (cropBottom - cropTop) / 3f - (1..2).forEach { index -> + for (index in 1..2) { val offsetX = cropLeft + thirdWidth * index val offsetY = cropTop + thirdHeight * index // Vertical guide line