@Rathan_G if you are using appium 1.7.2 and java client 6.0.0 beta5, u have to use absolute coordinates for 1.7.2
public void swipeRightToLeft() {
//getDriver().manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Dimension size = getDriver().manage().window().getSize();
System.out.println(size);
int startx = (int) (size.width *0.94);
int endx = (int) (size.width *0.24);
int starty = size.height / 2;
int finalendx = startx-endx;
int endy = 0;
TouchAction actions = new TouchAction(getDriver());
actions.press(point(startx,starty)).waitAction(waitOptions(Duration.ofMillis(2000))).moveTo(point(-finalendx,endy)).release().perform();
}
if you use above code you may need to import below lines.
import java.time.Duration;
import static io.appium.java_client.touch.offset.PointOption.point;
import static io.appium.java_client.touch.WaitOptions.waitOptions;