Skip to content

Commit

Permalink
Add region tags to auto advance pager examples (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeroseman authored Nov 27, 2024
1 parent f4e4987 commit 515b08e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ fun PagerIndicator() {
}
}

// [START android_compose_autoadvancepager]
@Composable
fun AutoAdvancePager(pageItems: List<Color>, modifier: Modifier = Modifier) {
Box(modifier = Modifier.fillMaxSize()) {
Expand Down Expand Up @@ -457,6 +458,7 @@ fun AutoAdvancePager(pageItems: List<Color>, modifier: Modifier = Modifier) {
PagerIndicator(pageItems.size, pagerState.currentPage)
}
}
// [END android_compose_autoadvancepager]

@Preview
@Composable
Expand All @@ -470,6 +472,7 @@ private fun AutoAdvancePagerPreview() {
AutoAdvancePager(pageItems = pageItems)
}

// [START android_compose_pagerindicator]
@Composable
fun PagerIndicator(pageCount: Int, currentPageIndex: Int, modifier: Modifier = Modifier) {
Box(modifier = Modifier.fillMaxSize()) {
Expand All @@ -494,6 +497,7 @@ fun PagerIndicator(pageCount: Int, currentPageIndex: Int, modifier: Modifier = M
}
}
}
// [END android_compose_pagerindicator]

@Preview
@Composable
Expand Down

0 comments on commit 515b08e

Please sign in to comment.