I implemented a simple HorizontalPager which works mostly as expected. The app I develop is for one specific device, a 8" Tablet in landscape mode. At the moment it is required to swipe more than 50% of the screen-width to get to the next/prev page. This is a very long swipe and I would like to reduce that to make changing pages easier...
I played around with fling behavior and tried to manually change pages when the offset changed or to intercept the touchevents...Nothing really lead to the desired behavior.
Since the "problem" seems so simple, I really hope that I have just overseen something. Do you have an idea what I could try?
multiplier = 5f
with my solution should definitely work – CavettoPagerDefaults.flingBehavior
source code and redefine it to your needs. There's no simple parameter like "screen scrolled percent",flingBehavior
is the only option – CavettoflingBehavior
source code and provide differentsnapIndex
– CavettolazyListState
? forflingBehavior
you only needPagerState
, and for customsnapIndex
it seems like you don't need anything at all - it's just a lambda – CavettoflingBehavior
internally does not implement the function that takessnapIndex
. Even copying the implementation and addingsnapIndex
won't help as @Marijn mentioned it needs alazyListState
so there is a problem. – Upmost