How to do Right and left in latest version of appium beacuse as we dont have swipe(driver.swipe) method in new appium version
public DailyPicksPage swipeDailyPicksCard() throws Exception {
Dimension size = agent.getMobileDriver().manage().window().getSize();
System.out.println("Dimensions of the screen" + size);
int startX = (int) (size.width * 0.80);
int endX = (int) (size.width * 0.20);
int width = size.width;
int duration = 2000;
int height = size.height;
int pressHeight = (int) (height * 0.80);
new TouchAction(agent.getMobileDriver()).press(PointOption.point(startX, pressHeight)).waitAction(WaitOptions.waitOptions(Duration.ofMillis(duration))).moveTo(PointOption.point(endX, pressHeight)).release().perform();
return new DailyPicksPage(params, agent);
}