public SwipeWithCustomFields()
 {
     data = new TestTry()
     {
         Coordinate = new System.Collections.Generic.List <Point>()
     };
     swipeDetector = new InternalSwipeGestureDetector()
     {
         SwipeAction = (CustomAndroidSwipeData obj) =>
         {
             var tap = swipeWithPositionCommand;
             if (tap != null)
             {
                 data.Coordinate.Clear();
                 data.Coordinate.Add(PxToDp(new Point(obj.start.GetX(), obj.start.GetY())));
                 data.Coordinate.Add(PxToDp(new Point(obj.end.GetX(), obj.end.GetY())));
                 data.CustomField1 = CalculateDirection(obj.start, obj.end);
                 if (tap.CanExecute(data))
                 {
                     tap.Execute(data);
                 }
             }
         },
     };
 }
Exemplo n.º 2
0
        private void CheckSwipeData(TestTry testTry)
        {
            var stringData = "";

            foreach (Point p in testTry.Coordinate)
            {
                stringData = stringData + "X:  " + p.X + "   Y:  " + p.Y + "       ";
            }
            if (!string.IsNullOrEmpty(testTry.CustomField1))
            {
                stringData = stringData + testTry.CustomField1 + "     ";
            }
            if (!string.IsNullOrEmpty(testTry.CustomField2))
            {
                stringData = stringData + testTry.CustomField2;
            }

            //if (Device.RuntimePlatform == Device.Android)
            //    App.Current.MainPage.DisplayAlert("Cooooool", "Not enough data captured Yet      XLEFT...." + testTry.Coordinate[0].X + "     YLEFT......." + testTry.Coordinate[0].Y
            //    + "XRIGHT...." + testTry.Coordinate[1].X + "     YRIGHT......." + testTry.Coordinate[1].Y + "        "+testTry.CustomField1+"         "+testTry.CustomField2, "OKKKKKK");
            ////"XUP...." + testTry.Coordinate[2].X + "     YUP......." + testTry.Coordinate[2].Y
            ////    + "XDOWN...." + testTry.Coordinate[3].X + "     YDOWN......." + testTry.Coordinate[3].Y, "OKKKKK");
            //else
            App.Current.MainPage.DisplayAlert("Cooooool", "THIS IS WHAT IS DONE>>>>" + stringData, "OKKKKKK");
        }
 public SwipeWithCustomFields()
 {
     data = new TestTry()
     {
         Coordinate = new List <Point>()
     };
     swipeDetectors = CreateSwipeRecognizer(() => swipeWithCustomdataCommand);;
 }
 /// <summary>
 /// Hides the Stat top bar and changes the dot location
 /// </summary>
 /// <param name="testTry"></param>
 private void Reset(TestTry testTry)
 {
     if (testTry.CustomField1 == "Up" && IsStatVisible)
     {
         IsStatVisible = false;
         StatDisplayModels.Clear();
         UpdateDotLocation();
         PositionVisiblity = false;
     }
 }
Exemplo n.º 5
0
        private void HandleTestTry(TestTry testTry)
        {
            var triedNumber = testTry.Number;

            Console.WriteLine("Chooser: Received Guess {0}", triedNumber);

            // TODO: an dieser Stelle müssen wir 3 Fälle behandeln:
            // triedNumber zu klein: TryTooSmall melden
            // triedNumber zu groß: TryTooBig melden
            // triedNumber passt: Guesed melden
            //
            // Nachrichten werden als Antwort versandt nach diesem Muster:
            // Sender.Tell(new MessageClass(args));
        }