コード例 #1
0
        public override bool OnTouchEvent(MotionEvent e)
        {
            TouchPoint point = new TouchPoint(e.GetX(), e.GetY());

            if (e.Action == MotionEventActions.Down)
            {
                _lastPoint = point;
            }
            else if (e.Action == MotionEventActions.Up)
            {
                var newPos = point;

                double dist = point.DisplacementFrom(_lastPoint);

                if (dist < THRESHOLD)
                {
                    _pinInputField.RequestFocus();

                    ShowKeyboard();
                    return(true);
                }
            }
            else if (e.Action == MotionEventActions.Move)
            {
                double dist = point.DisplacementFrom(_lastPoint);
                if (dist > THRESHOLD)
                {
                    _lastPoint = new TouchPoint(-1, -1);
                }
            }
            return(base.OnTouchEvent(e));
        }