Skip to content

Instantly share code, notes, and snippets.

@cp-radhika-s
Last active April 5, 2022 10:14
Show Gist options
  • Save cp-radhika-s/3e1dbeab704cdbdbd5e8d3c36f78b41e to your computer and use it in GitHub Desktop.
Save cp-radhika-s/3e1dbeab704cdbdbd5e8d3c36f78b41e to your computer and use it in GitHub Desktop.
@Composable
fun LongPressDraggable(
modifier: Modifier = Modifier,
content: @Composable BoxScope.() -> Unit
) {
val state = remember { DragTargetInfo() }
CompositionLocalProvider(
LocalDragTargetInfo provides state
) {
Box(
modifier = modifier
.fillMaxSize()
) {
content()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment