Exemple #1
0
        protected virtual void OnSwipeState(ref TouchQueueInfomation info, long time)
        {
            int x = 0;
            int y = 0;

            info.touchQueue.GetTrackStartingPosition(ref x, ref y);
            if (!info.touchQueue.IsActived() || (info.touchQueue.GetCurrentDuration(time) >= mMaxSwipeDuration))
            {
                TouchArcShape  arcType   = TouchArcShape.ARC_NONE;
                TouchDirection direction = TouchDirection.DIR_NONE;
                bool           isArc     = info.touchQueue.IsArcTrack(mMinXDistanceForArc, mMinYChangePersentForArc, ref arcType, ref direction);
                if (isArc)
                {
                    mCurrentGestureEvent = new GestureArcEvent(x, y, time, 1, arcType, direction);
                }
                else
                {
                    mCurrentGestureEvent = new GestureSwipeEvent(x, y, time, 1, direction);
                }

                //force deactive the touch queue when it expired
                if (info.touchQueue.IsActived())
                {
                    info.touchQueue.ForceReleaseTouch();
                }
            }
            else
            {
                mChangedTouchQueues.AddLast(info);
            }
        }
Exemple #2
0
 public GestureArcEvent(int x, int y, long time, int touchCount, TouchArcShape arcShape, TouchDirection direction) : base(x, y, time, touchCount)
 {
     mEventType     = GestureEventType.GESTURE_LONG_TAP;
     mIntParameter  = (int)arcShape;
     mIntParameter1 = (int)direction;
 }