Beispiel #1
0
 public AndroidDownUpEventArgs(MotionEvent current, View view, int[] startLocation)
 {
     Cancelled         = (current.Action == MotionEventActions.Cancel);
     ViewPosition      = AndroidEventArgsHelper.GetViewPosition(view);
     Touches           = AndroidEventArgsHelper.GetTouches(current, view, startLocation);
     TriggeringTouches = new [] { current.ActionIndex };
 }
Beispiel #2
0
 public AndroidSwipeEventArgs(MotionEvent end, View view, Direction direction, int[] startLocation)
 {
     Cancelled    = (end.Action == MotionEventActions.Cancel);
     ViewPosition = AndroidEventArgsHelper.GetViewPosition(view);
     Touches      = AndroidEventArgsHelper.GetTouches(end, view, startLocation);
     Direction    = direction;
 }
 public AndroidRotateEventArgs(MotionEvent current, MotionEvent.PointerCoords[] coords, RotateEventArgs previous, View view, int[] startLocation)
 {
     Cancelled    = (current.Action == MotionEventActions.Cancel);
     ViewPosition = AndroidEventArgsHelper.GetViewPosition(view);
     Touches      = AndroidEventArgsHelper.GetTouches(coords, previous, view, startLocation);
     CalculateAngles(previous);
 }
Beispiel #4
0
 public AndroidPanEventArgs(MotionEvent previous, MotionEvent current, PanEventArgs prevArgs, global::Android.Views.View view, int[] startLocation)
 {
     Cancelled    = (current.Action == MotionEventActions.Cancel);
     ViewPosition = AndroidEventArgsHelper.GetViewPosition(view);
     Touches      = AndroidEventArgsHelper.GetTouches(current, view, startLocation);
     CalculateDistances(prevArgs);
     Velocity = GetVelocity(previous, current);
 }
Beispiel #5
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 };
 }
Beispiel #6
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;
 }
 public AndroidPinchEventArgs(MotionEvent current, MotionEvent.PointerCoords[] coords, PinchEventArgs previous, View view, Listener listener)
 {
     Listener        = listener;
     Cancelled       = (current.Action == MotionEventActions.Cancel);
     ElementPosition = VisualElementExtensions.BoundsInWindowCoord(listener.Element);
     ElementTouches  = AndroidEventArgsHelper.GetTouches(coords, previous, view, listener);
     WindowTouches   = AndroidEventArgsHelper.GetTouches(coords, previous, view, null);
     //WindowTouches = AndroidEventArgsHelper.GetRawTouches(current);
     CalculateScales(previous);
 }
Beispiel #8
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;
 }
        public static Point[] GetTouches(MotionEvent.PointerCoords[] coords, BaseGestureEventArgs previous, Android.Views.View view, int[] startLocation)
        {
            int pointerCount = coords.Length;

            if (pointerCount < 2 && previous != null)
            {
                System.Diagnostics.Debug.WriteLine("\tPointerCount < requiredTouches");
                return(previous.Touches);
            }
            return(AndroidEventArgsHelper.GetTouches(coords, view, startLocation));
        }
Beispiel #10
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);
 }
Beispiel #11
0
 public AndroidTapEventArgs(MotionEvent tap, View view, int numberOfTaps, int[] startLocation)
 {
     //System.Diagnostics.Debug.WriteLine("tap0=["+tap.GetX()+","+tap.GetY()+"]");
     Cancelled = (tap.Action == MotionEventActions.Cancel);
     //System.Diagnostics.Debug.WriteLine("tap1=["+tap.GetX()+","+tap.GetY()+"]");
     ViewPosition = AndroidEventArgsHelper.GetViewPosition(view);
     //System.Diagnostics.Debug.WriteLine("tap2=["+tap.GetX()+","+tap.GetY()+"]");
     Touches = AndroidEventArgsHelper.GetTouches(tap, view, startLocation);
     //System.Diagnostics.Debug.WriteLine("tap3=["+tap.GetX()+","+tap.GetY()+"]");
     NumberOfTaps = numberOfTaps;
 }
Beispiel #12
0
        public AndroidLongPressEventArgs(MotionEvent start, MotionEvent end, View view, int[] startLocation)
        {
            MotionEvent e = end ?? start;

            Cancelled    = e.Action == MotionEventActions.Cancel;
            ViewPosition = AndroidEventArgsHelper.GetViewPosition(view);
            Touches      = AndroidEventArgsHelper.GetTouches(e, view, startLocation);
            if (start != null && end != null)
            {
                Duration = end.EventTime - start.EventTime;
            }
            else
            {
                Duration = 500;
            }
        }
        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;
            }
        }