summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-08-30 18:14:13 (GMT)
committerJason Smith <jason.smith@xamarin.com>2016-08-30 18:14:13 (GMT)
commitab0daa194734be0e45d8582e9254c447b464b27f (patch)
tree8549bb2248d8d51987b0e017c2855622d30209d9 /Xamarin.Forms.Platform.Android
parent1b7250167ff027bbd5ce3d2950a3e3495a13a5f7 (diff)
downloadxamarin-forms-ab0daa194734be0e45d8582e9254c447b464b27f.zip
xamarin-forms-ab0daa194734be0e45d8582e9254c447b464b27f.tar.gz
xamarin-forms-ab0daa194734be0e45d8582e9254c447b464b27f.tar.bz2
[A] PanGestureRecognizer will consistently send Completed event (#313)
* Adjust gallery page for reproduction * [A] Forward OnTouchEvent to Listener... ...and end scrolling on Up.
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/InnerGestureListener.cs8
-rw-r--r--Xamarin.Forms.Platform.Android/VisualElementRenderer.cs3
2 files changed, 10 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Android/InnerGestureListener.cs b/Xamarin.Forms.Platform.Android/InnerGestureListener.cs
index f83a1ac..8611af2 100644
--- a/Xamarin.Forms.Platform.Android/InnerGestureListener.cs
+++ b/Xamarin.Forms.Platform.Android/InnerGestureListener.cs
@@ -38,12 +38,18 @@ namespace Xamarin.Forms.Platform.Android
}
// This is needed because GestureRecognizer callbacks can be delayed several hundred milliseconds
- // which can result in the need to resurect this object if it has already been disposed. We dispose
+ // which can result in the need to resurrect this object if it has already been disposed. We dispose
// eagerly to allow easier garbage collection of the renderer
internal InnerGestureListener(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership)
{
}
+ internal void OnTouchEvent(MotionEvent e)
+ {
+ if (e.Action == MotionEventActions.Up)
+ EndScrolling();
+ }
+
bool GestureDetector.IOnDoubleTapListener.OnDoubleTap(MotionEvent e)
{
if (_tapDelegate == null || _tapGestureRecognizers == null)
diff --git a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
index 5274f89..404dd23 100644
--- a/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/VisualElementRenderer.cs
@@ -98,6 +98,9 @@ namespace Xamarin.Forms.Platform.Android
ScaleGestureDetectorCompat.SetQuickScaleEnabled(_scaleDetector.Value, true);
handled = _scaleDetector.Value.OnTouchEvent(e);
}
+
+ _gestureListener?.OnTouchEvent(e);
+
return _gestureDetector.Value.OnTouchEvent(e) || handled;
}