Exemplo n.º 1
0
        public bool OnSwipe(MotionEvent e)
        {
            mGestureDetector.OnTouchEvent(e);
            switch (e.Action)
            {
            case MotionEventActions.Down:
            {
                mDownX  = (int)e.GetX();
                IsFling = false;
            }
            break;

            case MotionEventActions.Move:
            {
                int dis = (int)(mDownX - e.GetX());
                if (state == STATE_OPEN)
                {
                    dis += MenuView.Width;
                }
                Swipe(dis);
            }
            break;

            case MotionEventActions.Up:
            {
                if (IsFling || (mDownX - e.GetX()) > (MenuView.Width / 2))
                {
                    SmoothOpenMenu();
                }
                else
                {
                    SmoothCloseMenu();
                    return(false);
                }
            }
            break;
            }
            return(true);
        }
Exemplo n.º 2
0
        public override bool OnTouchEvent(MotionEvent e)
        {
            gestureDetector?.OnTouchEvent(e);

            return(base.OnTouchEvent(e));
        }