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() {
4040
4141 val url = " "
4242
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-
5143 // [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
6048 )
61- } )
49+ )
6250 }
6351 // [END android_compose_drag_and_drop_2]
6452
6553 // [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+ )
7761 }
7862 // [END android_compose_drag_and_drop_3]
7963
You can’t perform that action at this time.
0 commit comments