/// <summary>
        /// Create a gesture type: DOUBLETAP.
        /// </summary>
        /// <param name="motionEvent">The gesture motion event: DOUBLETAP.</param>
        /// <returns>GestureEvent(DOUBLETAP).</returns>
        public static GestureEvent CreateDoubleTapEvent(MotionEvent motionEvent)
        {
            GestureEvent ret = new GestureEvent();

            ret.type       = GESTURE_EVENT_TYPE_DOUBLETAP;
            ret.eventFirst = motionEvent;
            return(ret);
        }
        /// <summary>
        /// Create a gesture type: SINGLETAPCONFIRM.
        /// </summary>
        /// <param name="motionEvent">The gesture motion event: SINGLETAPCONFIRM.</param>
        /// <returns>GestureEvent(SINGLETAPCONFIRM).</returns>
        public static GestureEvent CreateSingleTapConfirmEvent(MotionEvent motionEvent)
        {
            GestureEvent ret = new GestureEvent();

            ret.type       = GESTURE_EVENT_TYPE_SINGLETAPCONFIRMED;
            ret.eventFirst = motionEvent;
            return(ret);
        }
        /// <summary>
        /// Create a gesture type: SCROLL.
        /// </summary>
        /// <param name="e1">The first down motion event that started the scrolling.</param>
        /// <param name="e2">The second down motion event that ended the scrolling.</param>
        /// <param name="distanceX">The distance along the X axis that has been scrolled since the last call to onScroll.</param>
        /// <param name="distanceY">The distance along the Y axis that has been scrolled since the last call to onScroll.</param>
        /// <returns>GestureEvent(SCROLL).</returns>
        public static GestureEvent createScrollEvent(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
        {
            GestureEvent ret = new GestureEvent();

            ret.type        = GESTURE_EVENT_TYPE_SCROLL;
            ret.eventFirst  = e1;
            ret.eventSecond = e2;
            ret.distanceX   = distanceX;
            ret.distanceY   = distanceY;
            return(ret);
        }
Example #4
0
        public void OnGestureEvent(GestureEvent e)
        {
            bool offerResult = mQueuedSingleTaps.Offer(e);

            if (offerResult)
            {
                Log.Debug(TAG, "Successfully joined the queue.");
            }
            else
            {
                Log.Debug(TAG, "Failed to join queue.");
            }
        }
Example #5
0
 public override bool OnScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
 {
     mActivity.OnGestureEvent(GestureEvent.createScrollEvent(e1, e2, distanceX, distanceY));
     return(true);
 }
Example #6
0
 public override bool OnSingleTapConfirmed(MotionEvent e)
 {
     mActivity.OnGestureEvent(GestureEvent.CreateSingleTapConfirmEvent(e));
     return(true);
 }
Example #7
0
 public override bool OnDoubleTap(MotionEvent e)
 {
     mActivity.OnGestureEvent(GestureEvent.CreateDoubleTapEvent(e));
     return(true);
 }