Skip to content

Instantly share code, notes, and snippets.

@shoaibmushtaq25
Created December 4, 2024 06:00
Show Gist options
  • Save shoaibmushtaq25/a9dd4e7e1ca7f4eef3b9402db365e944 to your computer and use it in GitHub Desktop.
Save shoaibmushtaq25/a9dd4e7e1ca7f4eef3b9402db365e944 to your computer and use it in GitHub Desktop.
@Composable
fun CollapsibleThing(modifier: Modifier = Modifier) {
Surface(
modifier = modifier.fillMaxSize(), color = MaterialTheme.colorScheme.tertiary
) {
Box(
modifier = Modifier
.fillMaxSize()
.nestedScroll(connection)
) {
Column(modifier = Modifier.scrollable(
orientation = Orientation.Vertical,
// state for Scrollable, describes how consume scroll amount
state =
rememberScrollableState { delta ->
0f
}
)) {
ExpandedHeader(
modifier = Modifier,
)
LazyColumn(
modifier = Modifier
.fillMaxSize()
.weight(weight = 1f)
.background(Color.White)
) {
items(contents) {
ListItem(item = it)
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment