All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy