Exemplo n.º 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 };
 }
 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);
 }
Exemplo n.º 3
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;
 }
Exemplo n.º 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);
 }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
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;
            }
        }