OndrejKunc / SkiaScene

Simple API to transform SkiaSharp objects using functions like zoom and rotate or using gestures like pan and pinch.
MIT License
67 stars 18 forks source link

Add ability to respect Android touch slop for pan gestures #21

Closed Cheesebaron closed 4 years ago

Cheesebaron commented 4 years ago

If you set UseTouchSlop to true, the panning gesture on Android will respect the touch slop.

This prevents accidental movements of the SkiaCanvas.

It defaults to current behavior. However, we also may want to implement something similar to this for pinches.

This partially fixes #19

OndrejKunc commented 4 years ago

This looks great! Do you know if this is also an issue on iOS? From what I found there is no such thing as touch slop and we would need to implement it manually in the TouchRecognizer class. But I think this can be done later if it turns out it is also an issue.

There is also a NuGet package TouchTracking.Forms which exposes TouchHandler via RoutingEffect called TouchEffect, so maybe this UseTouchSlop property can be added there as well (which will be ignored on iOS). But to be honest, I don't follow Xamarin.Forms stack for a while so I have no idea if this package is still compatible with the newer versions of the framework and if it is still relevant to keep it updated in the current state...

Cheesebaron commented 4 years ago

We mainly experienced issues on Samsung S20+ and Xperia 5 Android devices. iOS seems to behave much nicer with regards to touches and accidental touches.

As for the Xamarin.Forms bits. I have no idea what the state of them are. The App I am working on is Xamarin.iOS + Xamarin.Android.

OndrejKunc commented 4 years ago

Fair enough. Let's merge it and I will take care about the Xamarin.Forms part myself if I find it necessary.