summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/InnerScaleListener.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Android/InnerScaleListener.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/InnerScaleListener.cs20
1 files changed, 8 insertions, 12 deletions
diff --git a/Xamarin.Forms.Platform.Android/InnerScaleListener.cs b/Xamarin.Forms.Platform.Android/InnerScaleListener.cs
index 4a6c6581..76f7629a 100644
--- a/Xamarin.Forms.Platform.Android/InnerScaleListener.cs
+++ b/Xamarin.Forms.Platform.Android/InnerScaleListener.cs
@@ -10,20 +10,16 @@ namespace Xamarin.Forms.Platform.Android
Action _pinchEndedDelegate;
Func<Point, bool> _pinchStartedDelegate;
- public InnerScaleListener(Func<float, Point, bool> pinchDelegate, Func<Point, bool> pinchStarted, Action pinchEnded)
+ public InnerScaleListener(PinchGestureHandler pinchGestureHandler)
{
- if (pinchDelegate == null)
- throw new ArgumentNullException("pinchDelegate");
-
- if (pinchStarted == null)
- throw new ArgumentNullException("pinchStarted");
-
- if (pinchEnded == null)
- throw new ArgumentNullException("pinchEnded");
+ if (pinchGestureHandler == null)
+ {
+ throw new ArgumentNullException(nameof(pinchGestureHandler));
+ }
- _pinchDelegate = pinchDelegate;
- _pinchStartedDelegate = pinchStarted;
- _pinchEndedDelegate = pinchEnded;
+ _pinchDelegate = pinchGestureHandler.OnPinch;
+ _pinchStartedDelegate = pinchGestureHandler.OnPinchStarted;
+ _pinchEndedDelegate = pinchGestureHandler.OnPinchEnded;
}
// This is needed because GestureRecognizer callbacks can be delayed several hundred milliseconds