Skip to content

Instantly share code, notes, and snippets.

@hkawii
Last active July 13, 2022 06:16
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/bd4806232b82c0aebd9421fc0f24f905 to your computer and use it in GitHub Desktop.
Save hkawii/bd4806232b82c0aebd9421fc0f24f905 to your computer and use it in GitHub Desktop.
fun MenuView(
modifier: Modifier = Modifier,
menuSections: List<MenuSections> = FakeData.menuData
) {
val scope = rememberCoroutineScope()
...
...
MenuSectionsView(
selectedIndex = selectedSectionIndex,
menuSections = menuSections,
sectionsListState = sectionsListState,
onClick = { sectionIndex ->
selectedSectionIndex = sectionIndex
scope.launch {
sectionsListState.animateScrollToItem(sectionIndex)
itemsListState.animateScrollToItem(sectionIndex)
}
}
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment