Skip to content

Instantly share code, notes, and snippets.

@ahmedrizwan
Created May 27, 2020 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmedrizwan/aa317d6a4725bc6f31f99787fb0de7c9 to your computer and use it in GitHub Desktop.
Save ahmedrizwan/aa317d6a4725bc6f31f99787fb0de7c9 to your computer and use it in GitHub Desktop.
// Side drag
val sideMin = 90.dp
val sideMax = boxWidth - 30.dp
val (sideMinPx, sideMaxPx) = with(DensityAmbient.current) {
sideMin.toPx().value to sideMax.toPx().value
}
val sideFlingConfig = AnchorsFlingConfig(listOf(sideMinPx, sideMaxPx))
val sidePosition = animatedFloat(sideMaxPx)
sidePosition.setBounds(sideMinPx, sideMaxPx)
val sideDrag = Drag(
position = sidePosition,
flingConfig = sideFlingConfig
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment