-
-
Save skydoves/a68032c6ee86f99b9dc186697920b810 to your computer and use it in GitHub Desktop.
sliding_composable
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
@Composable | |
fun SlidingComposable(scrollPositionProvider: () -> Int) { | |
val scrollPositionInDp = with(LocalDensity.current) { scrollPositionProvider().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