Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch overlay event consumed early in scroll view #15

Closed
Pfuster12 opened this issue Jul 11, 2020 · 1 comment
Closed

Touch overlay event consumed early in scroll view #15

Pfuster12 opened this issue Jul 11, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Pfuster12
Copy link
Owner

Observed behaviour
In a scrollview, touch overlay stops working if you move slightly up or down and trigger the scroll event of the parent.

version
1.2.0

@Pfuster12 Pfuster12 added the bug Something isn't working label Jul 11, 2020
@Pfuster12 Pfuster12 self-assigned this Jul 11, 2020
@Pfuster12 Pfuster12 added this to the v1.3.0 release milestone Jul 14, 2020
@Pfuster12
Copy link
Owner Author

Unfortunately this is a feature of the Android Touch system. Without ruining the ScrollView functionality from the library side, a working solution is to call the LiveChart view's parent requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) :

liveChart.setDataset(dataset)
                .setOnTouchCallbackListener(object : LiveChart.OnTouchCallback {
                    override fun onTouchCallback(point: DataPoint) {
                        liveChart
                            .parent
                            .requestDisallowInterceptTouchEvent(true)
                    }

                    override fun onTouchFinished() {
                         liveChart
                              .parent
                              .requestDisallowInterceptTouchEvent(false)
                     }
                })
                .drawDataset()

@Pfuster12 Pfuster12 pinned this issue Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant