bool global::Android.Views.View.IOnTouchListener.OnTouch(global::Android.Views.View v, MotionEvent e) { if (!_isEnabled) { return(true); } if (_inputTransparent) { return(false); } var handled = false; if (_pinchGestureHandler.IsPinchSupported) { if (!_scaleDetector.IsValueCreated) { ScaleGestureDetectorCompat.SetQuickScaleEnabled(_scaleDetector.Value, true); } handled = _scaleDetector.Value.OnTouchEvent(e); } if (_gestureDetector.IsValueCreated && _gestureDetector.Value.Handle == IntPtr.Zero) { // This gesture detector has already been disposed, probably because it's on a cell which is going away return(handled); } // It's very important that the gesture detection happen first here // if we check handled first, we might short-circuit and never check for tap/pan return(_gestureDetector.Value.OnTouchEvent(e) || handled); }
public NativePinchRecognizerRecognizer(Context context, PinchRecognizer recognizer) { _detector = new ScaleGestureDetector(context, this); _recognizer = recognizer; ScaleGestureDetectorCompat.SetQuickScaleEnabled(_detector, true); }
ScaleGestureDetector InitializeScaleDetector() { var listener = new InnerScaleListener(new PinchGestureHandler(() => View), Control.Context.FromPixels); var detector = new ScaleGestureDetector(Control.Context, listener, Control.Handler); ScaleGestureDetectorCompat.SetQuickScaleEnabled(detector, true); return(detector); }
bool IOnTouchListener.OnTouch(AView v, MotionEvent e) { var handled = false; if (_pinchGestureHandler.IsPinchSupported) { if (!_scaleDetector.IsValueCreated) { ScaleGestureDetectorCompat.SetQuickScaleEnabled(_scaleDetector.Value, true); } handled = _scaleDetector.Value.OnTouchEvent(e); } return(_gestureDetector.Value.OnTouchEvent(e) || handled); }
ScaleGestureDetector InitializeScaleDetector() { if (Control?.Context == null) { throw new InvalidOperationException("Context cannot be null here"); } var context = Control.Context; var listener = new InnerScaleListener(new PinchGestureHandler(() => View), context.FromPixels); var detector = new ScaleGestureDetector(context, listener, Control.Handler); ScaleGestureDetectorCompat.SetQuickScaleEnabled(detector, true); return(detector); }
bool IOnTouchListener.OnTouch(AView v, MotionEvent e) { var handled = false; if (_pinchGestureHandler.IsPinchSupported) { if (!_scaleDetector.IsValueCreated) { ScaleGestureDetectorCompat.SetQuickScaleEnabled(_scaleDetector.Value, true); } handled = _scaleDetector.Value.OnTouchEvent(e); } if (_gestureDetector.IsValueCreated && _gestureDetector.Value.Handle == IntPtr.Zero) { // This gesture detector has already been disposed, probably because it's on a cell which is going away return(handled); } return(_gestureDetector.Value.OnTouchEvent(e) || handled); }