Post

After figuring out how to make the coordinates work, it's so satisfying to use a live-updating drag and drop that previews where the dropped content will go.

Some quirks: writing automated tests for this was hard since the drag and drop is done at the system level. I found a super hacky way to do so by interleaving normal Compose testing utilities and raw MotionEvents injected with UiAutomation.

0 reposts1 like

Also Coil right now doesn't work well with the default drag decoration for Modifier.dragAndDropSource, which is unfortunate since dragging images seems like use case #1 for drag and drop. I think I have a decent workaround though: github.com/coil-kt/coil...