code: private ElementUI getVisibleChild(boolean first) {
          int count = getChildCount();
          int start = first ? 0 : count - 1;
          int inc = first ? 1 : -1;
          
          for (int i = start; i >= 0 && i < count; i += inc) {
              ElementUI child = (ElementUI) getChild(i);
  
              if (child.isVisible()) {
                  return child;
              }
          }
          
          return null;
      }
docs: Returns first or last visible child.
  
  @param first If true, find first visible child; if false, last visible child.
  @return Visible child, or null if none found.