protected override void Execute(CodeActivityContext context) { AndroidDriver <AndroidElement> driver; // Inherit driver from scope activity OR from input (if out of context) try { driver = context.DataContext.GetProperties()["Driver"].GetValue(context.DataContext) as AndroidDriver <AndroidElement>; } catch { driver = Driver.Get(context); } // Receive fields int startx = StartX.Get(context); int starty = StartY.Get(context); int endx = EndX.Get(context); int endy = EndY.Get(context); int delay = Delay.Get(context); // Apply delay Thread.Sleep(delay); // Tap on the element new TouchAction(driver).Press(startx, starty).Wait(300).MoveTo(endx, endy).Release().Perform(); }
public Vector3 GetEnd(float frame) { return(new Vector3( EndX.GetFrameValue(frame), EndY.GetFrameValue(frame), EndZ.GetFrameValue(frame))); }
public override double GetValue(double x) { double startX = StartX.GetValue(x); double startY = StartY.GetValue(x); double endX = EndX.GetValue(x); double endY = EndY.GetValue(x); if (x < startX) { // This makes it "flatline": x = startX; } else if (x > endX) { // This makes it "flatline": x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } // Read there: double y = SourceModule.GetValue(x); if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Return y: return(y); }
public override UnityEngine.Color GetColour(double x, double y) { double startX = StartX.GetValue(x, y); double startY = StartY.GetValue(x, y); double endX = EndX.GetValue(x, y); double endY = EndY.GetValue(x, y); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Read there: return(SourceModule.GetColour(x, y)); }
public override double GetWrapped(double x, double y, int wrap) { double startX = StartX.GetWrapped(x, y, wrap); double startY = StartY.GetWrapped(x, y, wrap); double endX = EndX.GetWrapped(x, y, wrap); double endY = EndY.GetWrapped(x, y, wrap); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Read there: return(SourceModule.GetWrapped(x, y, wrap)); }
public override double GetValue(double x, double y, double z) { double startX = StartX.GetValue(x, y, z); double startY = StartY.GetValue(x, y, z); double startZ = StartY.GetValue(x, y, z); double endX = EndX.GetValue(x, y, z); double endY = EndY.GetValue(x, y, z); double endZ = EndY.GetValue(x, y, z); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } if (z < startZ) { // This makes it "flatline": z = startZ; } else if (z > endZ) { // This makes it "flatline": z = endZ; } else { // Box z: z = (z - startZ) / (endZ - startZ); } // Read there: return(SourceModule.GetValue(x, y, z)); }