Skip to content

Instantly share code, notes, and snippets.

@hkawii
Created July 13, 2022 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkawii/522e362c95a3dfd7a2d2ed1a489db3ca to your computer and use it in GitHub Desktop.
Save hkawii/522e362c95a3dfd7a2d2ed1a489db3ca to your computer and use it in GitHub Desktop.
@Composable
fun MenuSectionsView(
selectedIndex: Int,
menuSections: List<MenuSections>,
sectionsListState: LazyListState,
onClick: (sectionIndex: Int) -> Unit
) {
LazyRow(
modifier = Modifier.padding(),
state = sectionsListState
) {
menuSections.forEachIndexed { i, section ->
item {
SectionTextView(
modifier = Modifier
.padding(horizontal = 10.dp)
.clickable { onClick(i) },
text = section.title,
isSelected = selectedIndex == i
)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment