https://kotlinlang.org logo
#compose
Title
# compose
i

iamthevoid

12/11/2021, 7:26 AM
I got strange behavior (it doesn't snap pages) on accompanist view pager interact. On the video at first i try swipe pages, then i use control to change pages, then swipe with fingers again. In case when I use pager control then pages snaps correctly, but when i use finger pager works like recycler view. Pager control is not the problem source, because i commented it and behavior haven't changed. Do you have any ideas what can lead that behavor? Or maybe somewho met same behavior?
y

YASAN

12/11/2021, 8:00 AM
Can you share some of your code? I use the accompanist view pager but never had such issues.
i

iamthevoid

12/11/2021, 8:03 AM
Sorry, but i can not. Now i am trying to reduce complexity and throw out all unnecessary, but hasn't got result yet
😐 1
y

YASAN

12/11/2021, 8:05 AM
Okay but I can just say that in my use I did not have such issue and it might be that there is something wrong in your code. But the library is not that stable so who knows.
i

iamthevoid

12/11/2021, 8:06 AM
Funny thing is i tried to reproduce it on sample project, but pager worked well
so yes, something lead this behavior, but i don't understand what i should to dig
y

YASAN

12/11/2021, 8:07 AM
Then that makes the possibility of your code having issues more
i

iamthevoid

12/11/2021, 8:11 AM
now pager page in same nav graph (animated nav graph) with bottom navigation screen, i do that because i need to code few fullscreen flows. And inside screen with bottom navigation i am also has view pager and it works well. I reduce complexity and now i fill bad working pager with only integers (transformed to
Text
), but it continues behave wrong
I understand that without source code my question looks funny. Hey, dudes, guess what happens with my code?
😄 3
But i hope that anybody mets same behavior and can advice me something
y

YASAN

12/11/2021, 8:15 AM
I have some weird issues & even crashes with the Accompanist view pager but no such scrolling issue
c

Colton Idle

12/12/2021, 2:33 PM
Yeah. I've had a lot of weird issues with pager, but not this. 😄
i

iamthevoid

12/12/2021, 2:35 PM
I had not enough time to find out the bug reason, but looks like animated nav controller can lead that
I’ve found the cause, it’s weird
I have modal navigation drawer over navigation graph and open screen with pager from navigation drawer before it closed
If i remove navigation drawer from equation - paging works well
If i add delay between nav drawer click (it closes on click) and open crean with pager all also works well
To clarify - i did not close navigation drawer before opening the screen with pager. it closed authomatically. If i close it by myself - pager also snapping