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 }; }
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); }
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 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); }
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; }
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; } }