Пример #1
0
 public AndroidDownUpEventArgs(MotionEvent current, Android.Views.View view, Listener listener)
 {
     Listener        = listener;
     Cancelled       = current.Action == MotionEventActions.Cancel;
     ElementPosition = listener.Element.BoundsInWindowCoord();
     ElementTouches  = AndroidEventArgsHelper.GetTouches(current, view, listener);
     //WindowTouches = AndroidEventArgsHelper.GetTouches(current, view, null);
     WindowTouches     = AndroidEventArgsHelper.GetRawTouches(current);
     TriggeringTouches = new [] { current.ActionIndex };
 }
Пример #2
0
 public AndroidTapEventArgs(MotionEvent current, View view, int numberOfTaps, Listener listener)
 {
     Listener        = listener;
     Cancelled       = (current.Action == MotionEventActions.Cancel);
     ElementPosition = VisualElementExtensions.BoundsInWindowCoord(listener.Element);
     ElementTouches  = AndroidEventArgsHelper.GetTouches(current, view, listener);
     //WindowTouches = AndroidEventArgsHelper.GetTouches(current, view, null);
     WindowTouches = AndroidEventArgsHelper.GetRawTouches(current);
     NumberOfTaps  = numberOfTaps;
 }
Пример #3
0
 public AndroidSwipeEventArgs(MotionEvent current, View view, Direction direction, Listener listener)
 {
     Listener        = listener;
     Cancelled       = current.Action == MotionEventActions.Cancel;
     ElementPosition = VisualElementExtensions.BoundsInWindowCoord(listener.Element);
     ElementTouches  = AndroidEventArgsHelper.GetTouches(current, view, listener);
     //WindowTouches = AndroidEventArgsHelper.GetTouches(current, view, null);
     WindowTouches = AndroidEventArgsHelper.GetRawTouches(current);
     Direction     = direction;
 }
Пример #4
0
 public AndroidPanEventArgs(MotionEvent previous, MotionEvent current, BaseGestureEventArgs prevArgs, Android.Views.View view, Listener listener)
 {
     Listener        = listener;
     Cancelled       = (current.Action == MotionEventActions.Cancel);
     ElementPosition = VisualElementExtensions.BoundsInWindowCoord(listener.Element);
     ElementTouches  = AndroidEventArgsHelper.GetTouches(current, view, listener);
     //WindowTouches = AndroidEventArgsHelper.GetTouches(current, view, null);
     WindowTouches = AndroidEventArgsHelper.GetRawTouches(current);
     CalculateDistances(prevArgs);
     Velocity = GetVelocity(previous, current);
 }
        public AndroidLongPressEventArgs(MotionEvent start, MotionEvent end, View view, Listener listener)
        {
            MotionEvent current = end ?? start;

            Listener        = listener;
            Cancelled       = current.Action == MotionEventActions.Cancel;
            ElementPosition = VisualElementExtensions.BoundsInWindowCoord(listener.Element);
            ElementTouches  = AndroidEventArgsHelper.GetTouches(current, view, listener);
            //WindowTouches = AndroidEventArgsHelper.GetTouches(current, view, null);
            WindowTouches = AndroidEventArgsHelper.GetRawTouches(current);
            if (start != null && end != null)
            {
                Duration = end.EventTime - start.EventTime;
            }
            else
            {
                Duration = 500;
            }
        }