Last active
October 22, 2022 03:22
-
-
Save AndroidPoet/840a2774cdcdfb4bb23197fe5a911f3f to your computer and use it in GitHub Desktop.
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 SecondRootComposable() { | |
Box(Modifier.fillMaxSize()) { // Recomposition Scope Start | |
val scroll = rememberScrollState(0) | |
Title(snack = snack,scroll=scroll.value) | |
} | |
} | |
@Composable | |
private fun Title(snack: Snack, ,scroll: Int) { | |
val offset = with(LocalDensity.current) { scroll.toDp() } | |
Column( | |
modifier = Modifier | |
.offset(y = offset) | |
) { | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment