highcharts-android icon indicating copy to clipboard operation
highcharts-android copied to clipboard

Gesture conflict with viewpager or some components else

Open royorange opened this issue 6 years ago • 5 comments

Hi, because we have the viewPager in our view, I find it has some conflict with it's touch event. When you want to see the chart, especially when you zoomed the chart, you don't want to be disturbed by viewPager when you fling left or right. RecyclerView also face this issue but has a vertical action.

I am trying to handle it by calling requestDisallowInterceptTouchEvent in the onInterceptTouchEvent , but I have to know the zoom level of the current state. Because when the chart is not zoomed, intercept all the events will cause the parent(like RecyclerView, ViewPage, etc.) not scroll, it's also not a good experience.

Is there some method to have the zoom level right now, or some better solution to fix it? Thanks!!

royorange avatar Jan 25 '19 07:01 royorange

Hello @royorange ! I am currently looking for a solution to this problem.

soommy12 avatar Jan 25 '19 15:01 soommy12

Hi @soommy12 ,

The same issue is discovered when using the HIChartView in the ScrollView. It also applies for a case when a user has started an interaction with a HIChartView in order to show a tooltip. As @royorange mentioned, probably determining a case when a user has started a zoom operation or horizontal one-finger gesture over the chart view (showing a tooltip) and calling requestDisallowInterceptTouchEvent(true) could help (and then calling the oopsite requestDisallowInterceptTouchEvent(false) when the chart-related gesture is finished/canceled).

It's definitely a responsibility of a library view to prevent outer view containers from stealing it's touch events.

I've created a sample project where a HiChartView is placed inside of a vertically scrollable container (zoom and tooltip are enabled): https://github.com/adenisyuk/HighchartsScrolling

adenisyuk avatar Jul 22 '19 15:07 adenisyuk

Thanks for the sample project, we really appreciate your effort. I will investigate.

soommy12 avatar Jul 23 '19 09:07 soommy12

Is there anything new with this issue?

krajzler avatar Oct 28 '23 22:10 krajzler