public bool OnTouch(View v, MotionEvent ev)
        {
            if (AnimatingZoomEnding || ev.PointerCount > 2)
            {
                return(true);
            }
            ScaleGestureDetector.OnTouchEvent(ev);
            GestureDetector.OnTouchEvent(ev);
            var action = ev.Action & MotionEventActions.Mask;

            switch (action)
            {
            case MotionEventActions.PointerDown:
            case MotionEventActions.Down:
                switch (State)
                {
                case STATE_IDLE:
                    State = STATE_POINTER_DOWN;
                    break;

                case STATE_POINTER_DOWN:
                    State = STATE_ZOOMING;
                    ev.MidPointOfEvent(InitialPinchMidPoint);
                    StartZoomingView(Target);
                    break;
                }
                break;

            case MotionEventActions.Move:
                if (State == STATE_ZOOMING)
                {
                    ev.MidPointOfEvent(CurrentMovementMidPoint);
                    CurrentMovementMidPoint.X -= InitialPinchMidPoint.X;
                    CurrentMovementMidPoint.Y -= InitialPinchMidPoint.Y;
                    CurrentMovementMidPoint.X += TargetViewCords.X;
                    CurrentMovementMidPoint.Y += TargetViewCords.Y;
                    float x = CurrentMovementMidPoint.X;
                    float y = CurrentMovementMidPoint.Y;
                    ZoomableView.SetX(x);
                    ZoomableView.SetY(y);
                }
                break;

            case MotionEventActions.PointerUp:
            case MotionEventActions.Up:
            case MotionEventActions.Cancel:
                switch (State)
                {
                case STATE_ZOOMING:
                    EndZoomingView();
                    break;

                case STATE_POINTER_DOWN:
                    State = STATE_IDLE;
                    break;
                }
                break;
            }
            return(true);
        }
 private void EndZoomingView()
 {
     if (Config.ZoomAnimationEnabled)
     {
         AnimatingZoomEnding = true;
         ZoomableView.Animate().X(TargetViewCords.X).Y(TargetViewCords.Y).ScaleX(1).ScaleY(1).SetInterpolator(EndZoomingInterpolator).WithEndAction(EndingZoomAction).Start();
     }
     else
     {
         EndingZoomAction.Run();
     }
 }