io.selendroid.server.action.touch.PointerCancel Maven / Gradle / Ivy
package io.selendroid.server.action.touch;
import io.selendroid.server.action.Action;
import io.selendroid.server.action.ActionContext;
import io.selendroid.server.model.SelendroidDriver;
import io.selendroid.server.model.TouchScreen;
import org.json.JSONException;
import org.json.JSONObject;
public class PointerCancel extends Action {
public PointerCancel(SelendroidDriver driver) {
super(driver);
}
@Override
public void perform(
JSONObject properties, ActionContext context) throws JSONException {
TouchScreen touchScreen = driver.getTouch();
if (context.getIsPressed()) {
touchScreen.up(context.getCurrentX(), context.getCurrentY());
context.release();
}
}
}