Need examples for pinch or zoom for server 1.8.1 and Java client 5

Can anyone please post example for pinch or zoom
can we do it around elements or with specific coordinates

thanks

What have you tried? Have you looked into TouchActions?

You probably want to use the 6.0.0 beta java client as well… the touch actions match up between them. Not sure how well tested java client 5 is with appium 1.8.x

public static void pinch(AppiumDriver<?> driver) {
	int scrHeight = driver.manage().window().getSize().getHeight(); // To get the mobile screen height
	int scrWidth = driver.manage().window().getSize().getWidth();// To get the mobile screen width
	MultiTouchAction multiTouch = new MultiTouchAction(driver);
	TouchAction touchAction4 = new TouchAction(driver);
	TouchAction touchAction3 = new TouchAction(driver);
	touchAction3.press(100, 100).waitAction(Duration.ofSeconds(1)).moveTo(scrWidth / 2, scrHeight / 2).release();
	touchAction4.press(scrWidth - 100, scrHeight - 100).waitAction(Duration.ofSeconds(1))
			.moveTo(scrWidth / 2, scrHeight / 2).release();
	multiTouch.add(touchAction3).add(touchAction4);
	multiTouch.perform();
}

HERE IS MY PINCH FUNCTION