-
-
Save saqib-github-commits/3a8a551393fdcf2d87180430ca6b6a66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun VerticalPagerWithImagesAndIndicatorsScreen() { | |
val images = listOf( | |
R.drawable.logo_android, | |
R.drawable.logo_kotlin, | |
R.drawable.logo_gradle, | |
R.drawable.logo_github, | |
R.drawable.logo_google, | |
) | |
Column { | |
VerticalPagerWithImagesAndIndicators(images) | |
} | |
} | |
@OptIn(ExperimentalFoundationApi::class) | |
@Composable | |
fun VerticalPagerWithImagesAndIndicators(images: List<Int>) { | |
val pagerState = rememberPagerState() | |
VerticalPager( | |
pageCount = 5, | |
pageSize = PageSize.Fixed(300.dp), | |
pageSpacing = 8.dp, | |
state = pagerState) { | |
Image( | |
painter = painterResource(id = images[it]), | |
contentScale = ContentScale.Crop, | |
contentDescription = "" ) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment