Skip to content

Instantly share code, notes, and snippets.

@hkawii
Last active July 13, 2022 05:44
Show Gist options
  • Save hkawii/e6046bd711d2aac35282cf6f981bac03 to your computer and use it in GitHub Desktop.
Save hkawii/e6046bd711d2aac35282cf6f981bac03 to your computer and use it in GitHub Desktop.
@Composable
fun MenuItemsView(
menuSections: List<MenuSections>,
itemsListState: LazyListState,
onPostScroll: () -> Unit
) {
LazyColumn(
state = itemsListState,
modifier = Modifier
.padding()
.nestedScroll(object : NestedScrollConnection {
override fun onPostScroll(
consumed: Offset,
available: Offset,
source: NestedScrollSource
): Offset {
onPostScroll()
return super.onPostScroll(consumed, available, source)
}
})
) {
menuSections.forEach { section ->
item {
Text(
modifier = Modifier.padding(10.dp),
text = section.title,
style = TextStyle(fontSize = 24.sp, fontWeight = FontWeight.Bold),
color = Purple200
)
MenuItemView(section)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment