private void removeOnGlobalLayoutListener(
    ViewTreeObserver observer,
    ViewTreeObserver.OnGlobalLayoutListener listener) {
    if (observer == null || !observer.isAlive()) {
      return;
    }

    if (Build.VERSION.SDK_INT < 16) {
      observer.removeGlobalOnLayoutListener(listener);
    } else {
      observer.removeOnGlobalLayoutListener(listener);
    }
  }
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