Hey, anyone tried already accompanist-pager?
s
Hey, anyone tried already accompanist-pager?
Expected second screen coming from right side on scroll… but it gives me same first screen 🤔
c
What’s the code look like? That definitely shouldn’t be happening, and our tests should be enforcing this.
s
I think i found it… I have used
currentPage
instead of value provided in pager scope
c
Should be the same thing. Are you storing the value?
s
Copy code
fun DemoScene() {
    val pagerState = rememberPagerState(pageCount = 5)

    HorizontalPager(state = pagerState) {
        Text(
            text = "Hello $currentPage",
            modifier = Modifier
                .fillMaxSize()
        )
    }
}
this produces same as on video above
c
Ah, you need to use the page parameter given to the content lambda
s
yeah, value from lambda works 👍
c
All of the samples show the correct way to use it: https://google.github.io/accompanist/pager/
s
great 😊 thanks for a quick response
👍 2