Exemple #1
0
        private void OnTouch(object sender, View.TouchEventArgs args)
        {
            switch (args.Event.Action)
            {
            case MotionEventActions.Down:
                if (EnableRipple)
                {
                    ForceStartRipple(args.Event.GetX(), args.Event.GetY());
                }
                else
                {
                    _rippleOnScreen = true;
                    TapAnimation(250, 0, 80);
                }
                break;

            case MotionEventActions.Up:
            case MotionEventActions.Cancel:
                args.Handled = false;
                if (EnableRipple)
                {
                    ForceEndRipple();
                }
                else
                {
                    _rippleOnScreen = false;
                    TapAnimation(250, 80);
                }
                break;
            }
        }
        void ViewOnTouch(object sender, View.TouchEventArgs args)
        {
            switch (args.Event.Action)
            {
            case MotionEventActions.Down:
                _tapTime = DateTime.Now;
                break;

            case MotionEventActions.Up:
                if (IsViewInBounds((int)args.Event.RawX, (int)args.Event.RawY))
                {
                    var range = (DateTime.Now - _tapTime).TotalMilliseconds;
                    if (range > 800)
                    {
                        LongClickHandler();
                    }
                    else
                    {
                        ClickHandler();
                    }
                }

                goto case MotionEventActions.Cancel;

            case MotionEventActions.Cancel:
                args.Handled = false;
                break;
            }
        }
Exemple #3
0
        private void ViewOnTouch(object sender, View.TouchEventArgs args)
        {
            switch (args.Event.Action)
            {
            case MotionEventActions.Down:
                _tapTime = DateTime.Now;
                break;

            case MotionEventActions.Up:
                if (IsViewInBounds((int)args.Event.RawX, (int)args.Event.RawY))
                {
                    if ((DateTime.Now - _tapTime).Milliseconds > 1500)
                    {
                        _view.PerformLongClick();
                    }
                    else
                    {
                        _view.CallOnClick();
                    }
                }

                goto case MotionEventActions.Cancel;

            case MotionEventActions.Cancel:
                args.Handled = false;
                break;
            }
        }
        void OnTouch(View.TouchEventArgs args)
        {
            switch (args.Event.Action)
            {
            case MotionEventActions.Down:
                if (EnableRipple)
                {
                    ForceStartRipple(args.Event.GetX(), args.Event.GetY());
                }
                else
                {
                    BringLayer();
                }

                break;

            case MotionEventActions.Up:
            case MotionEventActions.Cancel:
                if (IsDisposed)
                {
                    return;
                }

                if (EnableRipple)
                {
                    ForceEndRipple();
                }
                else
                {
                    TapAnimation(250, _alpha, 0);
                }

                break;
            }
        }
 void OnTouch(object sender, AView.TouchEventArgs e)
 {
     if (e.Event.Action == MotionEventActions.Up)
     {
         CreateDialog();
     }
 }
Exemple #6
0
        void OnTouch(View.TouchEventArgs args)
        {
            switch (args.Event.Action)
            {
            case MotionEventActions.Down:
                _tapTime = DateTime.Now;
                StartHoldTimer();
                break;

            case MotionEventActions.Up:
                if (IsViewInBounds((int)args.Event.RawX, (int)args.Event.RawY))
                {
                    var range = (DateTime.Now - _tapTime).TotalMilliseconds;
                    if (range > 800)
                    {
                        LongClickHandler();
                    }
                    else
                    {
                        ClickHandler();
                    }
                }
                StopHoldTimer();
                break;
            }
        }
        private void ControlOnTouch(object sender, View.TouchEventArgs touchEventArgs)
        {
            bool detectedUp = touchEventArgs.Event.Action == MotionEventActions.Up;

            if (gestureRecognizer?.OnTouchEvent(touchEventArgs.Event) == false && detectedUp)
            {
                tapDetector.PanEndAction?.Invoke(touchEventArgs.Event);
            }
        }
Exemple #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SurfaceView_Touch(object sender, View.TouchEventArgs e)
        {
            float x = e.Event.GetX();
            float y = e.Event.GetY();

            _ = e.Event.RawX;
            _ = e.Event.RawY;
            if (x > 100 && x < 500 && y > 100 & y < 500)
            {
                Draw(x, y);
            }
        }
        private void Control_Touched(object sender, View.TouchEventArgs e)
        {
            switch (e.Event.Action)
            {
            case MotionEventActions.Down:
                _holdGesture?.Trigger();
                break;

            case MotionEventActions.Up:
                _holdGesture?.Release();
                break;
            }
        }
Exemple #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _surfaceView_Touch(object sender, View.TouchEventArgs e)
        {
            float x    = e.Event.GetX();
            float y    = e.Event.GetY();
            float RawX = e.Event.RawX;
            float RawY = e.Event.RawY;

            if (x > 100 && x < 500 && y > 100 & y < 500)
            {
                Draw(x, y);
            }
            Android.Views.View touchedView = sender as View;                    // что тут происходит?? приводим sender к типу View??
        }
Exemple #11
0
 void OnTouchDown(AView.TouchEventArgs e)
 {
     IsCanceled = false;
     startX     = e.Event.GetX();
     startY     = e.Event.GetY();
     effect?.HandleUserInteraction(TouchInteractionStatus.Started);
     effect?.HandleTouch(TouchStatus.Started);
     StartRipple(e.Event.GetX(), e.Event.GetY());
     if (effect.DisallowTouchThreshold > 0)
     {
         Group.Parent?.RequestDisallowInterceptTouchEvent(true);
     }
 }
Exemple #12
0
        void OnTouchMove(object sender, AView.TouchEventArgs e)
        {
            if (IsCanceled)
            {
                return;
            }

            var diffX   = Math.Abs(e.Event.GetX() - startX) / View.Context.Resources.DisplayMetrics.Density;
            var diffY   = Math.Abs(e.Event.GetY() - startY) / View.Context.Resources.DisplayMetrics.Density;
            var maxDiff = Math.Max(diffX, diffY);
            var disallowTouchThreshold = effect.DisallowTouchThreshold;

            if (disallowTouchThreshold > 0 && maxDiff > disallowTouchThreshold)
            {
                HandleEnd(TouchStatus.Canceled);
                return;
            }

            var view = sender as AView;

            if (view == null)
            {
                return;
            }

            var screenPointerCoords = new Point(view.Left + e.Event.GetX(), view.Top + e.Event.GetY());
            var viewRect            = new Rectangle(view.Left, view.Top, view.Right - view.Left, view.Bottom - view.Top);
            var status = viewRect.Contains(screenPointerCoords) ? TouchStatus.Started : TouchStatus.Canceled;

            if (isHoverSupported && ((status == TouchStatus.Canceled && effect.HoverStatus == HoverStatus.Entered) ||
                                     (status == TouchStatus.Started && effect.HoverStatus == HoverStatus.Exited)))
            {
                effect?.HandleHover(status == TouchStatus.Started ? HoverStatus.Entered : HoverStatus.Exited);
            }

            if (effect.Status != status)
            {
                effect?.HandleTouch(status);
                if (status == TouchStatus.Started)
                {
                    StartRipple(e.Event.GetX(), e.Event.GetY());
                }
                if (status == TouchStatus.Canceled)
                {
                    EndRipple();
                }
            }
        }
Exemple #13
0
 private void _view_Touch(object sender, View.TouchEventArgs e)
 {
     if (_worldGen != null)
     {
         _view.SetLoadedWorld(_worldGen.GetWorld());
         _view.Touch -= _view_Touch;
         return;
     }
     if (e.Event.Action == MotionEventActions.Up)
     {
         _view.TapTap(e.Event.GetX(), e.Event.GetY(), _rowsSeekBar.Progress, _rankSeekBar.Progress, GetUnitType());
         _totalInSquadEditText.Text = (_rankSeekBar.Progress * _rowsSeekBar.Progress).ToString();
         _totalUnitsEditText.Text   = _view.Army.Size.ToString();
         UpdateSelectors();
     }
 }
        void OnPlatformViewTouched(object?sender, AView.TouchEventArgs e)
        {
            if (_disposed)
            {
                var platformView = Control;
                if (platformView != null)
                {
                    platformView.Touch -= OnPlatformViewTouched;
                }

                return;
            }

            if (e.Event != null)
            {
                OnTouchEvent(e.Event);
            }
        }
Exemple #15
0
        private void OnTouch(object sender, AView.TouchEventArgs e)
        {
            switch (e.Event.ActionMasked)
            {
            case MotionEventActions.Down:
                Element.GetTouchEff().HandleTouch(TouchStatus.Started);
                break;

            case MotionEventActions.Up:
                Element.GetTouchEff().HandleTouch(TouchStatus.Completed);
                break;

            case MotionEventActions.Cancel:
                Element.GetTouchEff().HandleTouch(TouchStatus.Canceled);
                break;
            }
            e.Handled = true;
        }
Exemple #16
0
        void OnNativeViewTouched(object?sender, Android.Views.View.TouchEventArgs e)
        {
            if (_disposed)
            {
                var nativeView = Control;
                if (nativeView != null)
                {
                    nativeView.Touch -= OnNativeViewTouched;
                }

                return;
            }

            if (e.Event != null)
            {
                OnTouchEvent(e.Event);
            }
        }
Exemple #17
0
        void OnTouch(object sender, AView.TouchEventArgs e)
        {
            e.Handled = false;

            if (effect?.IsDisabled ?? true)
            {
                return;
            }

            if (IsAccessibilityMode)
            {
                return;
            }

            switch (e.Event.ActionMasked)
            {
            case MotionEventActions.Down:
                OnTouchDown(e);
                break;

            case MotionEventActions.Up:
                OnTouchUp();
                break;

            case MotionEventActions.Cancel:
                OnTouchCancel();
                break;

            case MotionEventActions.Move:
                OnTouchMove(sender, e);
                break;

            case MotionEventActions.HoverEnter:
                OnHoverEnter();
                break;

            case MotionEventActions.HoverExit:
                OnHoverExit();
                break;
            }
        }
        private void OnTouch(object sender, View.TouchEventArgs args)
        {
            // Two object common to all the events
            var senderView  = sender as View;
            var motionEvent = args.Event;

            int[] twoIntArray = new int[2];
            senderView.GetLocationOnScreen(twoIntArray);

            var list = new List <Point>();

            for (var pointerIndex = 0; pointerIndex < motionEvent.PointerCount; pointerIndex++)
            {
                list.Add(new Point(twoIntArray[0] + motionEvent.GetX(pointerIndex),
                                   twoIntArray[1] + motionEvent.GetY(pointerIndex)));
            }

            var screenPointerCoords = list.ToArray();
            var id = motionEvent.GetPointerId(motionEvent.ActionIndex);

            // Use ActionMasked here rather than Action to reduce the number of possibilities
            switch (args.Event.ActionMasked)
            {
            case MotionEventActions.Down:
            case MotionEventActions.PointerDown:
                FireEvent(this, id, TouchActionType.Pressed, screenPointerCoords, true);
                break;

            case MotionEventActions.Move:
                FireEvent(this, id, TouchActionType.Moved, screenPointerCoords, true);
                break;

            case MotionEventActions.Up:
            case MotionEventActions.Pointer1Up:
                FireEvent(this, id, TouchActionType.Released, screenPointerCoords, false);
                break;
            }
        }
Exemple #19
0
        private void OnTouch(object sender, View.TouchEventArgs args)
        {
            args.Handled = false;

            switch (args.Event.Action)
            {
            case MotionEventActions.Down:
                Container.RemoveView(_layer);
                Container.AddView(_layer);
                _layer.Top    = 0;
                _layer.Left   = 0;
                _layer.Right  = _view.Width;
                _layer.Bottom = _view.Height;
                _layer.BringToFront();
                TapAnimation(250, 0, 80, false);
                break;

            case MotionEventActions.Up:
            case MotionEventActions.Cancel:
                TapAnimation(250, 80);
                break;
            }
        }
Exemple #20
0
        private void OnTouch(object sender, View.TouchEventArgs args)
        {
            switch (args.Event.Action)
            {
            case MotionEventActions.Down:
                _tapTime = DateTime.Now;
                _rect    = new Rect(_viewOverlay.Left, _viewOverlay.Top, _viewOverlay.Right, _viewOverlay.Bottom);
                TapAnimation(250, 0, 80);
                break;

            case MotionEventActions.Move:
                _touchEndInside = _rect.Contains(
                    _viewOverlay.Left + (int)args.Event.GetX(),
                    _viewOverlay.Top + (int)args.Event.GetY());
                break;

            case MotionEventActions.Up:
                if (_touchEndInside)
                {
                    if ((DateTime.Now - _tapTime).Milliseconds > 1500)
                    {
                        _viewOverlay.PerformLongClick();
                    }
                    else
                    {
                        _viewOverlay.CallOnClick();
                    }
                }

                goto case MotionEventActions.Cancel;

            case MotionEventActions.Cancel:
                args.Handled = false;
                TapAnimation(250, 80);
                break;
            }
        }
Exemple #21
0
        void OnOverlayTouch(object sender, AView.TouchEventArgs e)
        {
            _view?.DispatchTouchEvent(e.Event);

            e.Handled = false;
        }
Exemple #22
0
        void OnTouch(object sender, AView.TouchEventArgs args)
        {
            // Two object common to all the events
            AView       senderView  = sender as AView;
            MotionEvent motionEvent = args.Event;

            // Get the pointer index
            int pointerIndex = motionEvent.ActionIndex;

            // Get the id that identifies a finger over the course of its progress
            int id = motionEvent.GetPointerId(pointerIndex);


            senderView.GetLocationOnScreen(_twoIntArray);
            Point screenPointerCoords = new Point(_twoIntArray[0] + motionEvent.GetX(pointerIndex),
                                                  _twoIntArray[1] + motionEvent.GetY(pointerIndex));


            // Use ActionMasked here rather than Action to reduce the number of possibilities
            switch (args.Event.ActionMasked)
            {
            case MotionEventActions.Down:
            case MotionEventActions.PointerDown:
                FireEvent(this, id, TouchActionType.Pressed, screenPointerCoords, true);

                idToEffectDictionary.Add(id, this);

                _capture = _libTouchEffect.Capture;
                break;

            case MotionEventActions.Move:
                // Multiple Move events are bundled, so handle them in a loop
                for (pointerIndex = 0; pointerIndex < motionEvent.PointerCount; pointerIndex++)
                {
                    id = motionEvent.GetPointerId(pointerIndex);

                    if (_capture)
                    {
                        senderView.GetLocationOnScreen(_twoIntArray);

                        screenPointerCoords = new Point(_twoIntArray[0] + motionEvent.GetX(pointerIndex),
                                                        _twoIntArray[1] + motionEvent.GetY(pointerIndex));

                        FireEvent(this, id, TouchActionType.Moved, screenPointerCoords, true);
                    }
                    else
                    {
                        CheckForBoundaryHop(id, screenPointerCoords);

                        if (idToEffectDictionary[id] != null)
                        {
                            FireEvent(idToEffectDictionary[id], id, TouchActionType.Moved, screenPointerCoords, true);
                        }
                    }
                }
                break;

            case MotionEventActions.Up:
            case MotionEventActions.Pointer1Up:
                if (_capture)
                {
                    FireEvent(this, id, TouchActionType.Released, screenPointerCoords, false);
                }
                else
                {
                    CheckForBoundaryHop(id, screenPointerCoords);

                    if (idToEffectDictionary[id] != null)
                    {
                        FireEvent(idToEffectDictionary[id], id, TouchActionType.Released, screenPointerCoords, false);
                    }
                }
                idToEffectDictionary.Remove(id);
                break;

            case MotionEventActions.Cancel:
                if (_capture)
                {
                    FireEvent(this, id, TouchActionType.Cancelled, screenPointerCoords, false);
                }
                else
                {
                    if (idToEffectDictionary[id] != null)
                    {
                        FireEvent(idToEffectDictionary[id], id, TouchActionType.Cancelled, screenPointerCoords, false);
                    }
                }
                idToEffectDictionary.Remove(id);
                break;
            }
        }
        private void OnViewOnTouch(object sender, View.TouchEventArgs e)
        {
            switch (e.Event.ActionMasked)
            {
            case MotionEventActions.ButtonPress:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Pressing);
                break;

            case MotionEventActions.ButtonRelease:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Released);
                break;

            case MotionEventActions.Cancel:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Cancelled);
                break;

            case MotionEventActions.Down:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Pressing);
                break;

            case MotionEventActions.HoverEnter:
                break;

            case MotionEventActions.HoverExit:
                break;

            case MotionEventActions.HoverMove:
                break;

            case MotionEventActions.Mask:
                break;

            case MotionEventActions.Move:
                break;

            case MotionEventActions.Outside:
                break;

            case MotionEventActions.Pointer1Down:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Pressing);
                break;

            case MotionEventActions.Pointer1Up:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Released);
                break;

            case MotionEventActions.Pointer2Down:
                break;

            case MotionEventActions.Pointer2Up:
                break;

            case MotionEventActions.Pointer3Down:
                break;

            case MotionEventActions.Pointer3Up:
                break;

            case MotionEventActions.PointerIdMask:
                break;

            case MotionEventActions.PointerIdShift:
                break;

            case MotionEventActions.Up:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Released);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemple #24
0
        private void OnViewOnTouch(object sender, View.TouchEventArgs e)
        {
            switch (e.Event.ActionMasked)
            {
            case MotionEventActions.ButtonPress:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Pressing);
                break;

            case MotionEventActions.ButtonRelease:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Released);
                break;

            case MotionEventActions.Cancel:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Cancelled);
                break;

            case MotionEventActions.Down:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Pressing);
                break;

            case MotionEventActions.HoverEnter:
                break;

            case MotionEventActions.HoverExit:
                break;

            case MotionEventActions.HoverMove:
                break;

            case MotionEventActions.Mask:
                break;

            case MotionEventActions.Move:
                var motionEvent = e.Event as MotionEvent;

                if (motionEvent != null)
                {
                    var x = motionEvent.GetX();
                    var y = motionEvent.GetY();

                    if (!this.firstX.HasValue || !this.firstY.HasValue)
                    {
                        this.firstX = x;
                        this.firstY = y;
                    }

                    var maxDelta = 10;
                    var deltaX   = Math.Abs(x - this.firstX.Value);
                    var deltaY   = Math.Abs(y - this.firstY.Value);
                    if (!this.ignored && (deltaX > maxDelta || deltaY > maxDelta))
                    {
                        this.ignored = true;
                        _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Ignored);
                    }
                }
                break;

            case MotionEventActions.Outside:
                break;

            case MotionEventActions.Pointer1Down:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Pressing);
                break;

            case MotionEventActions.Pointer1Up:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Released);
                break;

            case MotionEventActions.Pointer2Down:
                break;

            case MotionEventActions.Pointer2Up:
                break;

            case MotionEventActions.Pointer3Down:
                break;

            case MotionEventActions.Pointer3Up:
                break;

            case MotionEventActions.PointerIdMask:
                break;

            case MotionEventActions.PointerIdShift:
                break;

            case MotionEventActions.Up:
                _touchAndPressEffectConsumer?.ConsumeEvent(EventType.Released);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            if (e.Event.ActionMasked != MotionEventActions.Move)
            {
                this.ignored = false;
                this.firstX  = null;
                this.firstY  = null;
            }
        }
Exemple #25
0
        private void OnTouch(object sender, AView.TouchEventArgs e)
        {
            if (_effect?.IsDisabled ?? true)
            {
                return;
            }

            if (IsAccessibilityMode)
            {
                return;
            }
            e.Handled = true;
            switch (e.Event.ActionMasked)
            {
            case MotionEventActions.Down:
                IsCanceled = false;
                _startX    = e.Event.GetX();
                _startY    = e.Event.GetY();
                _effect?.HandleTouch(TouchStatus.Started);
                StartRipple(e.Event.GetX(), e.Event.GetY());
                if (_effect.DisallowTouchThreshold > 0)
                {
                    Group.Parent?.RequestDisallowInterceptTouchEvent(true);
                }
                break;

            case MotionEventActions.Up:
                HandleEnd(_effect.Status == TouchStatus.Started ? TouchStatus.Completed : TouchStatus.Canceled);
                break;

            case MotionEventActions.Cancel:
                HandleEnd(TouchStatus.Canceled);
                break;

            case MotionEventActions.Move:
                if (IsCanceled)
                {
                    return;
                }
                var diffX   = Abs(e.Event.GetX() - _startX) / View.Context.Resources.DisplayMetrics.Density;
                var diffY   = Abs(e.Event.GetY() - _startY) / View.Context.Resources.DisplayMetrics.Density;
                var maxDiff = Max(diffX, diffY);
                var disallowTouchThreshold = _effect.DisallowTouchThreshold;
                if (disallowTouchThreshold > 0 && maxDiff > disallowTouchThreshold)
                {
                    HandleEnd(TouchStatus.Canceled);
                    return;
                }
                var view = sender as AView;
                var screenPointerCoords = new Xamarin.Forms.Point(view.Left + e.Event.GetX(), view.Top + e.Event.GetY());
                var viewRect            = new Rectangle(view.Left, view.Top, view.Right - view.Left, view.Bottom - view.Top);
                var status = viewRect.Contains(screenPointerCoords) ? TouchStatus.Started : TouchStatus.Canceled;

                if (_isHoverSupported && ((status == TouchStatus.Canceled && _effect.HoverStatus == HoverStatus.Entered) ||
                                          (status == TouchStatus.Started && _effect.HoverStatus == HoverStatus.Exited)))
                {
                    _effect?.HandleHover(status == TouchStatus.Started ? HoverStatus.Entered : HoverStatus.Exited);
                }

                if (_effect.Status != status)
                {
                    _effect?.HandleTouch(status);
                    if (status == TouchStatus.Started)
                    {
                        StartRipple(e.Event.GetX(), e.Event.GetY());
                    }
                    if (status == TouchStatus.Canceled)
                    {
                        EndRipple();
                    }
                }
                break;

            case MotionEventActions.HoverEnter:
                _isHoverSupported = true;
                _effect?.HandleHover(HoverStatus.Entered);
                break;

            case MotionEventActions.HoverExit:
                _isHoverSupported = true;
                _effect?.HandleHover(HoverStatus.Exited);
                break;

            default:
                e.Handled = false;
                break;
            }
        }
Exemple #26
0
 void OnViewTouch(object sender, AView.TouchEventArgs e)
 {
     e.Handled = false;
 }
Exemple #27
0
 void OnTouch(object sender, AView.TouchEventArgs e)
 {
     MessagingCenter.Send(this as object, Bugzilla57114._57114NativeGestureFiredMessage);
     e.Handled = false;
 }
 private void ControlOnTouch(object sender, View.TouchEventArgs touchEventArgs)
 {
     gestureRecognizer?.OnTouchEvent(touchEventArgs.Event);
 }
Exemple #29
0
        private void OnTouch(object sender, AView.TouchEventArgs args)
        {
            var senderView  = sender as AView;
            var motionEvent = args.Event;

            var pointerIndex = motionEvent.ActionIndex;

            var id = motionEvent.GetPointerId(pointerIndex);

            senderView.GetLocationOnScreen(_twoIntArray);
            Point screenPointerCoords = new Point(_twoIntArray[0] + motionEvent.GetX(pointerIndex),
                                                  _twoIntArray[1] + motionEvent.GetY(pointerIndex));


            // Use ActionMasked here rather than Action to reduce the number of possibilities
            switch (args.Event.ActionMasked)
            {
            case MotionEventActions.Down:
            case MotionEventActions.PointerDown:
                FireEvent(this, id, TouchActionType.Pressed, screenPointerCoords, true);

                _ = _idToEffectDictionary.TryAdd(id, this);

                capture = libTouchEffect.Capture;
                break;

            case MotionEventActions.Move:
                // Multiple Move events are bundled, so handle them in a loop
                for (pointerIndex = 0; pointerIndex < motionEvent.PointerCount; pointerIndex++)
                {
                    id = motionEvent.GetPointerId(pointerIndex);

                    if (capture)
                    {
                        senderView.GetLocationOnScreen(_twoIntArray);

                        screenPointerCoords = new Point(_twoIntArray[0] + motionEvent.GetX(pointerIndex),
                                                        _twoIntArray[1] + motionEvent.GetY(pointerIndex));

                        FireEvent(this, id, TouchActionType.Moved, screenPointerCoords, true);
                    }
                    else
                    {
                        CheckForBoundaryHop(id, screenPointerCoords);

                        if (_idToEffectDictionary[id] != null)
                        {
                            FireEvent(_idToEffectDictionary[id], id, TouchActionType.Moved, screenPointerCoords, true);
                        }
                    }
                }
                break;

            case MotionEventActions.Up:
            case MotionEventActions.Pointer1Up:
                if (capture)
                {
                    FireEvent(this, id, TouchActionType.Released, screenPointerCoords, false);
                }
                else
                {
                    CheckForBoundaryHop(id, screenPointerCoords);

                    if (_idToEffectDictionary[id] != null)
                    {
                        FireEvent(_idToEffectDictionary[id], id, TouchActionType.Released, screenPointerCoords, false);
                    }
                }
                _idToEffectDictionary.Remove(id);
                break;

            case MotionEventActions.Cancel:
                if (capture)
                {
                    FireEvent(this, id, TouchActionType.Cancelled, screenPointerCoords, false);
                }
                else
                {
                    if (_idToEffectDictionary[id] != null)
                    {
                        FireEvent(_idToEffectDictionary[id], id, TouchActionType.Cancelled, screenPointerCoords, false);
                    }
                }
                _idToEffectDictionary.Remove(id);
                break;
            }
        }