Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created Aug 12, 2022
Embed
What would you like to do?
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