Skip to content

Instantly share code, notes, and snippets.

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 saqib-github-commits/869d44c2153cf5f5613b6f13d729a850 to your computer and use it in GitHub Desktop.
Save saqib-github-commits/869d44c2153cf5f5613b6f13d729a850 to your computer and use it in GitHub Desktop.
Button(
enabled = prevButtonVisible.value,
onClick = {
val prevPageIndex = pagerState.currentPage - 1
coroutineScope.launch { pagerState.animateScrollToPage(prevPageIndex) }
},
) {
Text(text = "Prev")
}
Button(
enabled = nextButtonVisible.value ,
onClick = {
val nextPageIndex = pagerState.currentPage + 1
coroutineScope.launch { pagerState.animateScrollToPage(nextPageIndex) }
},
) {
Text(text = "Next")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment