alexvasilkov / GestureViews

ImageView and FrameLayout with gestures control and position animation
Apache License 2.0
2.38k stars 384 forks source link

Sensitivity of Dragging horizonrally #109

Closed 6563572 closed 6 years ago

6563572 commented 6 years ago

this is a query,
dragging is not responded when sliding a short offset, must slide a far distance to prev/next item in view pager, observed in the example of recycled and viewpager, is there any api to tune the sensitivity?

6563572 commented 6 years ago

Thanks in advance

alexvasilkov commented 6 years ago

When image is zoomed out to its min zoom level sliding offset will be default android's offset so there should not be any problems here.

When image is zoomed in this sliding offset will be increased to prevent accidental page flips. In my opinion it is pretty annoying when you are scrolling zoomed image around but then it accidentally flips the page and you have to flip it back to previous image. The more you zoom in the image the harder it will be to flip the page.

There is no API to set the sensitivity unfortunately, not sure if it is this important. You can try to set GestureControllerForPager#SCROLL_THRESHOLD to a lower value with reflection, but I would not really recommend it. Another option is to not use enableScrollInViewPager() method at all, in this case you will only be able to flip pages in a min zoom.

6563572 commented 6 years ago

Thanks, I will give a shot.