Skip to content

Commit 093ff2c

Browse files
author
Rob Orgiu
committed
Simplify Drag&Drop implementation
1 parent d42262c commit 093ff2c

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsResourceCard.kt

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import androidx.compose.foundation.Canvas
2424
import androidx.compose.foundation.ExperimentalFoundationApi
2525
import androidx.compose.foundation.Image
2626
import androidx.compose.foundation.draganddrop.dragAndDropSource
27-
import androidx.compose.foundation.gestures.detectTapGestures
2827
import androidx.compose.foundation.horizontalScroll
2928
import androidx.compose.foundation.layout.Arrangement
3029
import androidx.compose.foundation.layout.Box
@@ -140,18 +139,14 @@ fun NewsResourceCardExpanded(
140139
modifier = Modifier
141140
.fillMaxWidth((.8f))
142141
.dragAndDropSource {
143-
detectTapGestures(
144-
onLongPress = {
145-
startTransfer(
146-
DragAndDropTransferData(
147-
ClipData.newPlainText(
148-
sharingLabel,
149-
sharingContent,
150-
),
151-
flags = dragAndDropFlags,
152-
),
153-
)
154-
},
142+
startTransfer(
143+
DragAndDropTransferData(
144+
ClipData.newPlainText(
145+
sharingLabel,
146+
sharingContent,
147+
),
148+
flags = dragAndDropFlags,
149+
),
155150
)
156151
},
157152
)

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
accompanist = "0.34.0"
33
androidDesugarJdkLibs = "2.0.4"
44
# AGP and tools should be updated together
5-
androidGradlePlugin = "8.6.1"
5+
androidGradlePlugin = "8.7.2"
66
androidTools = "31.7.2"
77
androidxActivity = "1.9.3"
88
androidxAppCompat = "1.7.0"
99
androidxBrowser = "1.8.0"
10-
androidxComposeBom = "2024.09.00"
10+
androidxComposeBom = "2024.11.00"
1111
androidxComposeRuntimeTracing = "1.0.0-beta01"
1212
androidxCore = "1.13.1"
1313
androidxCoreSplashscreen = "1.0.1"

0 commit comments

Comments
 (0)