Пример #1
0
        public override bool OnTouchEvent(MotionEvent e)
        {
            if (!this.Enabled)
            {
                return(false);
            }

            TouchDelegate delegte = null;

            switch (e.Action)
            {
            case MotionEventActions.Down:
                for (int i = 0; i < this.mTouchDelegates.Count; i++)
                {
                    TouchDelegate touchDelegate = mTouchDelegates[i];
                    if (touchDelegate.OnTouchEvent(e))
                    {
                        mCurrentTouchDelegate = touchDelegate;
                        return(true);
                    }
                }
                break;

            case MotionEventActions.Move:
                delegte = mCurrentTouchDelegate;
                break;

            case MotionEventActions.Cancel:
            case MotionEventActions.Up:
                delegte = mCurrentTouchDelegate;
                mCurrentTouchDelegate = null;
                break;
            }

            return(delegte != null && delegte.OnTouchEvent(e));
        }
Пример #2
0
 public void clearTouchDelegates()
 {
     mTouchDelegates.Clear();
     mCurrentTouchDelegate = null;
 }