File tree Expand file tree Collapse file tree 1 file changed +12
-28
lines changed
compose/snippets/src/main/java/com/example/compose/snippets/draganddrop Expand file tree Collapse file tree 1 file changed +12
-28
lines changed Original file line number Diff line number Diff line change @@ -40,40 +40,24 @@ private fun DragAndDropSnippet() {
40
40
41
41
val url = " "
42
42
43
- // [START android_compose_drag_and_drop_1]
44
- Modifier .dragAndDropSource {
45
- detectTapGestures(onLongPress = {
46
- // Transfer data here.
47
- })
48
- }
49
- // [END android_compose_drag_and_drop_1]
50
-
51
43
// [START android_compose_drag_and_drop_2]
52
- Modifier .dragAndDropSource {
53
- detectTapGestures(onLongPress = {
54
- startTransfer(
55
- DragAndDropTransferData (
56
- ClipData .newPlainText(
57
- " image Url" , url
58
- )
59
- )
44
+ Modifier .dragAndDropSource { _ ->
45
+ DragAndDropTransferData (
46
+ ClipData .newPlainText(
47
+ " image Url" , url
60
48
)
61
- } )
49
+ )
62
50
}
63
51
// [END android_compose_drag_and_drop_2]
64
52
65
53
// [START android_compose_drag_and_drop_3]
66
- Modifier .dragAndDropSource {
67
- detectTapGestures(onLongPress = {
68
- startTransfer(
69
- DragAndDropTransferData (
70
- ClipData .newPlainText(
71
- " image Url" , url
72
- ),
73
- flags = View .DRAG_FLAG_GLOBAL
74
- )
75
- )
76
- })
54
+ Modifier .dragAndDropSource { _ ->
55
+ DragAndDropTransferData (
56
+ ClipData .newPlainText(
57
+ " image Url" , url
58
+ ),
59
+ flags = View .DRAG_FLAG_GLOBAL
60
+ )
77
61
}
78
62
// [END android_compose_drag_and_drop_3]
79
63
You can’t perform that action at this time.
0 commit comments