Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support scrollbars for LazyColumn with reverseLayout = true #209

Closed
igordmn opened this issue Dec 22, 2020 · 2 comments
Closed

Support scrollbars for LazyColumn with reverseLayout = true #209

igordmn opened this issue Dec 22, 2020 · 2 comments
Assignees
Labels
bug Something isn't working scroll

Comments

@igordmn
Copy link
Collaborator

igordmn commented Dec 22, 2020

Box {
    val state = rememberLazyListState()
    val itemCount = 100
    val itemHeight = 20.dp

    LazyColumn(state = state, reverseLayout = true) {
        items((1..itemCount).toList()) { x ->
            Text(x.toString(), Modifier.graphicsLayer(alpha = 0.5f).height(itemHeight))
        }
    }

    VerticalScrollbar(
        rememberScrollbarAdapter(state, itemCount, itemHeight),
        Modifier.align(Alignment.CenterEnd)
    )
}

For now (0.3.0-build136) scrollbar in this case doesn't work as expected.

@igordmn igordmn added the bug Something isn't working label Dec 22, 2020
@igordmn igordmn self-assigned this Dec 22, 2020
@igordmn igordmn added the scroll label Jan 22, 2021
copybara-service bot pushed a commit to androidx/androidx that referenced this issue May 24, 2021
Fixes JetBrains/compose-multiplatform#209

```
Box(Modifier.width(200.dp)) {
    val state = rememberLazyListState()
    val itemCount = 100
    val itemHeight = 20.dp

    LazyColumn(Modifier.fillMaxWidth(), state = state, reverseLayout = true) {
        items((1..itemCount).toList()) { x ->
            Text(x.toString(), Modifier.graphicsLayer(alpha = 0.5f).height(itemHeight))
        }
    }

    VerticalScrollbar(
        rememberScrollbarAdapter(state, itemCount, itemHeight),
        Modifier.align(Alignment.CenterEnd),
        reverseLayout = true,
    )
}
```

Test: ./gradlew jvmTest desktopTest -Pandroidx.compose.multiplatformEnabled=true
Test: manual see code above
Change-Id: I2b6c0d793b0e62c490948f2fbbd9bf3e14230b8d
@igordmn
Copy link
Collaborator Author

igordmn commented May 25, 2021

Fixed in 0.4.0-build210 0.4.0-build211.

Added a parameter reverseLayout to VerticalScrollbar/HorizontalScrollbar

@igordmn igordmn closed this as completed May 25, 2021
@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scroll
Projects
None yet
Development

No branches or pull requests

2 participants