Skip to content

Instantly share code, notes, and snippets.

@arcadefire
Last active September 12, 2021 17:25
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 arcadefire/af42e638e4462041767a92211d7704d8 to your computer and use it in GitHub Desktop.
Save arcadefire/af42e638e4462041767a92211d7704d8 to your computer and use it in GitHub Desktop.
BoxWithConstraints {
val constraintsScope = this
val maxHeight = with(LocalDensity.current) {
constraintsScope.maxHeight.toPx()
}
Box(
Modifier
.swipeable(
/* ... */
anchors = mapOf(
0f to States.EXPANDED,
maxHeight to States.COLLAPSED,
)
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment