private void clickOnScreen(float x, float y) {
    SelendroidLogger.debug(String.format("Clicking at position [%f, %f]", x, y));
    final ServerInstrumentation inst = instrumentation;
    long downTime = SystemClock.uptimeMillis();
    long eventTime = SystemClock.uptimeMillis();
    final MotionEvent event =
        MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, x, y, 0);
    final MotionEvent event2 =
        MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, x, y, 0);

    try {
      inst.getInstrumentation().sendPointerSync(event);
      inst.getInstrumentation().sendPointerSync(event2);
      try {
        Thread.sleep(300);
      } catch (InterruptedException ignored) {}
    } catch (SecurityException e) {
      SelendroidLogger.error("error while clicking element", e);
    }
  }
If view.isShown() == false, logs why exactly this evaluates to false.
Copied from Android's implementation of View.isShown().
selendroid-server/src/main/java/io/selendroid/server/model/AndroidNativeElement.java