Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created August 12, 2022 01: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 skydoves/fc97b7b66bcadb241eb0c4a31bdc683a to your computer and use it in GitHub Desktop.
Save skydoves/fc97b7b66bcadb241eb0c4a31bdc683a to your computer and use it in GitHub Desktop.
defer_example
@Composable
fun SlidingComposable(scrollPosition: Int) {
val scrollPositionInDp = with(LocalDensity.current) { scrollPosition.toDp() }
Card(
modifier = Modifier.offset(scrollPositionInDp),
backgroundColor = Color.Cyan
) {
Text(
text = "Hello I slide out"
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment