Create and [remember] the [NestedScrollConnection] that enables Nested Scroll Interop between a View parent that implements [androidx.
@Composable
fun ComposeInCooperatingViewNestedScrollInteropSample() {
val nestedSrollInterop = rememberNestedScrollInteropConnection()
// Add the nested scroll connection to your top level @Composable element
// using the nestedScroll modifier.
LazyColumn(modifier = Modifier.nestedScroll(nestedSrollInterop)) {
items(20) { item ->
Box(
modifier =
Modifier.padding(16.dp).height(56.dp).fillMaxWidth().background(Color.Gray),
contentAlignment = Alignment.Center,
) {
Text(item.toString())
}
}
}
}