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

HorizontalPager shows scroll glow on each page change #767

Closed
zoltish opened this issue Oct 4, 2021 · 4 comments · Fixed by #810
Closed

HorizontalPager shows scroll glow on each page change #767

zoltish opened this issue Oct 4, 2021 · 4 comments · Fixed by #810

Comments

@zoltish
Copy link

zoltish commented Oct 4, 2021

Describe the bug

Whenever I scroll to a new page, the scroll glow shows as if Ive reached the end of the list even though there are several items left.

To Reproduce

Im seeing the same behavior seemingly regardless of my setup, all using HorizontalPager.

Expected behavior

The glow effect should only show when trying to scroll past the first/last item in the list.

Environment:

  • Android OS version: API 30
  • Device: Emulator, Pixel 4
  • Accompanist version: 0.19.0
@LittleBoxOfChicken
Copy link

Also happening to me.
API 31
Pixel 4a
Accompanist version: 0.19.0

There are a lot of things wrong with the pager right now. Why did they break everything like this and remove so many useful features?

@ghasemdev
Copy link

Describe the bug

Whenever I scroll to a new page, the scroll glow shows as if Ive reached the end of the list even though there are several items left.

To Reproduce

Im seeing the same behavior seemingly regardless of my setup, all using HorizontalPager.

Expected behavior

The glow effect should only show when trying to scroll past the first/last item in the list.

Environment:

  • Android OS version: API 30
  • Device: Emulator, Pixel 4
  • Accompanist version: 0.19.0

Accompanist version 0.19.0 is compatible with version 1.0.3 Jetpack Compose.
It is noteworthy that in version 1.1.0-alpha03 the scrolling effects feature has been added and if you use this version it will cause these effects to be activated and in version 0.19.0 the pager had changes that above LazyColumn and LazyRow to be made.

Well, the question is, what can be done? I recently realized that this effect can be turned off this way

NoScrollEffect {
    HorizontalPager(
    count = items.size,
    state = pagerState,
    modifier = Modifier
        .fillMaxSize()
        .align(Alignment.Center),
) { page ->

}
        
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun NoScrollEffect(content: @Composable () -> Unit) {
    CompositionLocalProvider(LocalOverScrollConfiguration provides null) {
        content()
    }
}

@zoltish
Copy link
Author

zoltish commented Oct 29, 2021

This works better in 0.21.0-beta, but I would still like to see (or rather, hide) the edge effects when scrolling to the first/last item. In my opinion it should only show up when trying to drag past the first/last item.

@andkulikov
Copy link
Collaborator

Hey! I can't reproduce it on the latest version. Please provide a code sample reproducing the issue if you want me to take a look on it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants