Category:
Appium
public void horizontalSwipeByPercentage (double startPercentage, double endPercentage, double anchorPercentage) {
Dimension size = driver.manage().window().getSize();
int anchor = (int) (size.height * anchorPercentage);
int startPoint = (int) (size.width * startPercentage);
int endPoint = (int) (size.width * endPercentage);
TouchAction touch = new TouchAction(driver);
touch.press(point(startPoint, anchor))
.waitAction(waitOptions(ofMillis(1000)))
.moveTo(point(endPoint, anchor))
.release().perform();
}