highcharts / highcharts-android

Android wrapper for Highcharts usage
Other
126 stars 30 forks source link

Still (partial) gesture conflict with scrollable container #288

Open jacobmattsson opened 2 weeks ago

jacobmattsson commented 2 weeks ago

Just as the reporter of https://github.com/highcharts/highcharts-android/issues/63, I too experienced problems (when using 11.4.3 of the Android wrapper) with zooming in my four charts (that are placed in a RecyclerView).

After upgrading to 11.4.5, zooming in the charts works great! 👍

But ... now, it's instead very hard to scroll up and down in the RecyclerView. It seems like the charts are stealing the scroll events when the touch events are initiated within the bounds of a chart, since the RecyclerView is not scrolled at all in that case. Wouldn't it be possible to not intercept single finger touch events (i.e. (usually vertical) scroll events in the scrollable container) but only intercept two finger touch events (pinch-to-zoom events and pan events)!? That would be the ideal solution (imho)!

With the current state of 11.4.5, I have no choice rather than to downgrade to 11.4.3 to get the scrolling working again and to disable zooming in the charts (since zooming barely works in 11.4.3 when charts are placed in a scrollable container).

Thanks!

jacobmattsson commented 2 weeks ago

Just to confirm - I experience the same problem with scrolling the RecyclerView in the sample project supplied in #63 with Android wrapper version 11.4.5. But scrolling works with 11.4.3. So it's not only in my own app ... Let me know if you want an updated sample project!

MikolajMichalczak commented 1 week ago

Hi @jacobmattsson!

There is a feature called ScrollablePlotArea that allows for horizontal or vertical scrolling of the chart with a single finger. Because of this, we can't implement touch event interception specifically for two-finger gestures without potentially causing issues similar to those reported in issue #63.

In version 11.4.5, we aimed to strike a balance with scroll sensitivity. Please try scrolling the RecyclerView with a shorter and more energetic swipe, and perform chart scrolling with a short press and slower swipe. Let me know how this works out for you in version 11.4.5.