Horizontal swipe in appium java client 7.0.0 is not working

I am trying to swipe horizontally in appium android - java-client 7.0.0. It doesn’t work

I am trying to swipe horizontally in appium android - java-client 7.0.0. It doesn’t work

//Horizontal Swipe by percentages
public void horizontalSwipeByPercentages(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);

    new TouchAction(driver)
        .press(PointOption.point(endPoint, startPoint))
        .waitAction(new WaitOptions().withDuration(Duration.ofMillis(600)))
        .moveTo(PointOption.point(startPoint, endPoint))
        .release().perform();
}

Called as below in my test. horizontalSwipeByPercentages(0.2,0.5,0.5);

By doing this, code is pulling notification bar

Try using Horizontal swipe method listed here