@Override
  public Object executeScript(JSONArray args) {
    SelendroidLogger.info("executing script isElementDisplayedInViewport");

    try {
      String elementId = args.getJSONObject(0).getString("ELEMENT");
      AndroidElement element = knownElements.get(elementId);
      if (element instanceof AndroidNativeElement) {
        return isDisplayedOnViewport(((AndroidNativeElement) element).getView());
      }
      return false;
    } catch (JSONException e) {
      SelendroidLogger.error("Cannot check if element is displayed in viewport", e);
      return false;
    }
  }
@deprecated Please use new implemented extension mechanism
@see <a href="https://github.com/selendroid/selendroid-extension">extension mechanism Docu</a>
selendroid-server/src/main/java/io/selendroid/server/model/internal/execute_native/IsElementDisplayedInViewport.java