Skip to content

Instantly share code, notes, and snippets.

@Ahmad-Hamwi
Created March 19, 2023 18:49
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 Ahmad-Hamwi/ac931f2c3b01b59e869c7dd37660f50e to your computer and use it in GitHub Desktop.
Save Ahmad-Hamwi/ac931f2c3b01b59e869c7dd37660f50e to your computer and use it in GitHub Desktop.
@Composable
fun TabSyncComposeScreen(categories: List<Category>) {
val (selectedTabIndex, setSelectedTabIndex, lazyListState) = lazyListTabSync(categories.indices.toList())
Column {
MyTabBar(
categories = categories,
selectedTabIndex = selectedTabIndex,
onTabClicked = { index, _ -> setSelectedTabIndex(index) }
)
MyLazyList(categories, lazyListState)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment