Created
March 13, 2024 01:35
-
-
Save CostaFot/d9dcc9eb2a2aab1732349fb36d16e529 to your computer and use it in GitHub Desktop.
This file contains 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 BoxWithConstraintsScope.draggableBox() { | |
Box( | |
modifier = Modifier | |
.fillMaxWidth() | |
.height(boxHeight) | |
.background(Color.White) | |
.align(Alignment.BottomCenter) | |
.pointerInput(Unit) { | |
detectVerticalDragGestures { change, dragAmount -> | |
if (dragAmount < 0f) { | |
// dragging up | |
} else if (dragAmount > 0f) { | |
// dragging down | |
} | |
} | |
} | |
) { | |
Image( .... ) // doggo here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment