Created
May 27, 2020 11:20
-
-
Save ahmedrizwan/fcd99c548d3ba638c6b8ae989f954d98 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
// Top drag | |
val topStart = -(constraints.maxHeight.value / 1.4f) | |
val topMax = 0.dp | |
val topMin = -(boxHeight / 1.4f) | |
val (topMinPx, topMaxPx) = with(DensityAmbient.current) { | |
topMin.toPx().value to topMax.toPx().value | |
} | |
val topFlingConfig = AnchorsFlingConfig(listOf(topMinPx, topMaxPx)) | |
val topPosition = animatedFloat(topStart) // for dragging state | |
topPosition.setBounds(topMinPx, topMaxPx) | |
val topDrag = Drag( | |
position = topPosition, | |
flingConfig = topFlingConfig | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment