Created
December 4, 2024 06:00
-
-
Save shoaibmushtaq25/a9dd4e7e1ca7f4eef3b9402db365e944 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 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