code: protected boolean hasDividerBeforeChildAt(int childIndex) {
          if (childIndex == 0) {
              return (mShowDividers & SHOW_DIVIDER_BEGINNING) != 0;
          } else if (childIndex == getChildCount()) {
              return (mShowDividers & SHOW_DIVIDER_END) != 0;
          } else if ((mShowDividers & SHOW_DIVIDER_MIDDLE) != 0) {
              boolean hasVisibleViewBefore = false;
              for (int i = childIndex - 1; i >= 0; i--) {
                  if (getChildAt(i).getVisibility() != GONE) {
                      hasVisibleViewBefore = true;
                      break;
                  }
              }
              return hasVisibleViewBefore;
          }
          return false;
      }
docs: Determines where to position dividers between children.
  
  @param childIndex Index of child to check for preceding divider
  @return true if there should be a divider before the child at childIndex
  @hide Pending API consideration. Currently only used internally by the system.