Esempio n. 1
0
  private void drawDividersVertical(Canvas canvas) {
    final int count = getChildCount();
    for (int i = 0; i < count; i++) {
      final View child = getChildAt(i);

      if (child != null && child.getVisibility() != GONE) {
        if (hasDividerBeforeChildAt(i)) {
          final LayoutParams lp = (LayoutParams) child.getLayoutParams();
          final int top = child.getTop() - lp.topMargin /* - mDividerHeight*/;
          drawHorizontalDivider(canvas, top);
        }
      }
    }

    if (hasDividerBeforeChildAt(count)) {
      final View child = getChildAt(count - 1);
      int bottom;
      if (child == null) {
        bottom = getHeight() - getPaddingBottom() - mDividerHeight;
      } else {
        // final LayoutParams lp = (LayoutParams) child.getLayoutParams();
        bottom = child.getBottom() /* + lp.bottomMargin*/;
      }
      drawHorizontalDivider(canvas, bottom);
    }
  }