Last active
April 5, 2022 10:14
-
-
Save cp-radhika-s/3e1dbeab704cdbdbd5e8d3c36f78b41e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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