As described in the issue #93, pinch gestures sometimes caused expanding the image and swiping the pages concurrently.
This pull request resolve it by using the nested scroll system instead of controlling cosumption of PointerInputEvents.
Before
If the detected PointerInputEvents were recognized as a pinch gesture, Modifier.zoomable() consumed them to enlarge the image.
On the other hands, if they were recognized as a swipe gesture, Modifier.zoomable() didn't consume them and propagated them to the Pager.
However, the event was propagated to the Pager until the determination of whether the gesture was a pinch gesture or a swipe gesture was completed.
If the gesture was determined to be a pinch gesture after several PointerInputEvents were propagated to the Pager, both the Pager swipe and the image enlargement were occurring simultaneously.
After
Now Modifier.zoomable() consumes all of PointerInputEvents.
After Modifier.zoomable() determines that the gesture is a swipe gesture, it issues a scroll event using NestedScrollDispatcher.
API Change
Pass ZoomableDefault.pageNestedScrollConnection to Pager when you apply Modifier.zoomable() to the contents on the Pager.
Issue
Overview
As described in the issue #93, pinch gestures sometimes caused expanding the image and swiping the pages concurrently. This pull request resolve it by using the nested scroll system instead of controlling cosumption of
PointerInputEvent
s.Before
If the detected
PointerInputEvent
s were recognized as a pinch gesture,Modifier.zoomable()
consumed them to enlarge the image. On the other hands, if they were recognized as a swipe gesture,Modifier.zoomable()
didn't consume them and propagated them to the Pager. However, the event was propagated to the Pager until the determination of whether the gesture was a pinch gesture or a swipe gesture was completed. If the gesture was determined to be a pinch gesture after severalPointerInputEvent
s were propagated to the Pager, both the Pager swipe and the image enlargement were occurring simultaneously.After
Now
Modifier.zoomable()
consumes all ofPointerInputEvent
s. AfterModifier.zoomable()
determines that the gesture is a swipe gesture, it issues a scroll event usingNestedScrollDispatcher
.API Change
Pass
ZoomableDefault.pageNestedScrollConnection
to Pager when you applyModifier.zoomable()
to the contents on the Pager.