From fe19853fa471d93c938d1aacf06ec659a77ef7c3 Mon Sep 17 00:00:00 2001 From: MohamedRejeb Date: Sun, 13 Oct 2024 14:08:45 +0100 Subject: [PATCH] run spotlessApply --- .../mohamedrejeb/compose/dnd/DragAndDropInfo.kt | 15 +++++++++++++++ .../mohamedrejeb/compose/dnd/drop/DropTarget.kt | 15 ++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd/DragAndDropInfo.kt b/compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd/DragAndDropInfo.kt index 8288809..40ec3bf 100644 --- a/compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd/DragAndDropInfo.kt +++ b/compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd/DragAndDropInfo.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2023, Mohamed Ben Rejeb and the Compose Dnd project contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.mohamedrejeb.compose.dnd import androidx.compose.runtime.staticCompositionLocalOf diff --git a/compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd/drop/DropTarget.kt b/compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd/drop/DropTarget.kt index 4528057..f403f59 100644 --- a/compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd/drop/DropTarget.kt +++ b/compose-dnd/src/commonMain/kotlin/com/mohamedrejeb/compose/dnd/drop/DropTarget.kt @@ -146,15 +146,17 @@ private data class DropTargetNode( override fun onAttach() { isShadow = currentValueOf(LocalDragAndDropInfo).isShadow - if (isShadow) + if (isShadow) { return + } state.addDropTarget(dropTargetState) } override fun onPlaced(coordinates: LayoutCoordinates) { - if (isShadow) + if (isShadow) { return + } state.addDropTarget(dropTargetState) @@ -166,22 +168,25 @@ private data class DropTargetNode( } override fun onRemeasured(size: IntSize) { - if (isShadow) + if (isShadow) { return + } dropTargetState.size = size.toSize() } override fun onReset() { - if (isShadow) + if (isShadow) { return + } state.removeDropTarget(key) } override fun onDetach() { - if (isShadow) + if (isShadow) { return + } state.removeDropTarget(key) }