s

    sashjakk

    1 year ago
    Hey, anyone tried already accompanist-pager?
    Expected second screen coming from right side on scroll… but it gives me same first screen 🤔
    cb

    cb

    1 year ago
    What’s the code look like? That definitely shouldn’t be happening, and our tests should be enforcing this.
    s

    sashjakk

    1 year ago
    I think i found it… I have used
    currentPage
    instead of value provided in pager scope
    cb

    cb

    1 year ago
    Should be the same thing. Are you storing the value?
    s

    sashjakk

    1 year ago
    fun DemoScene() {
        val pagerState = rememberPagerState(pageCount = 5)
    
        HorizontalPager(state = pagerState) {
            Text(
                text = "Hello $currentPage",
                modifier = Modifier
                    .fillMaxSize()
            )
        }
    }
    this produces same as on video above
    cb

    cb

    1 year ago
    Ah, you need to use the page parameter given to the content lambda
    s

    sashjakk

    1 year ago
    yeah, value from lambda works 👍
    cb

    cb

    1 year ago
    All of the samples show the correct way to use it: https://google.github.io/accompanist/pager/
    s

    sashjakk

    1 year ago
    great 😊 thanks for a quick response