app/src/main/java/com/yvrun/officeprocess/wight/decoration/RecycleViewDivider.java
private void drawVertical(Canvas canvas, RecyclerView parent) {
        canvas.save();
        final int left;
        final int right;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && parent.getClipToPadding()) {
            left = parent.getPaddingLeft() + mBuilder.mMarginLeft;
            right = parent.getWidth() - parent.getPaddingRight() - mBuilder.mMarginRight;
            canvas.clipRect(left, parent.getPaddingTop(), right, parent.getHeight() - parent.getPaddingBottom());
        } else {
            left = mBuilder.mMarginLeft;
            right = parent.getWidth() - mBuilder.mMarginRight;
        }

        int childCount = parent.getChildCount();
        int top;
        int bottom;
        int count = parent.getAdapter().getItemCount();
        for (int i = 0; i < childCount; i++) {
            final View child = parent.getChildAt(i);
            int position = parent.getChildAdapterPosition(child);
            if (needSkip(position, count)) {
                continue;
            }
            parent.getLayoutManager().getDecoratedBoundsWithMargins(child, mBounds);
            bottom = mBounds.bottom + Math.round(ViewCompat.getTranslationY(child));
            top = bottom - mDivider.getIntrinsicHeight();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(canvas);
        }

        if (childCount > 0 && mBuilder.mShowTopDivider) {
            final View child = parent.getChildAt(0);
            parent.getLayoutManager().getDecoratedBoundsWithMargins(child, mBounds);
            top = mBounds.top + Math.round(ViewCompat.getTranslationY(child));
            bottom = top + mDivider.getIntrinsicHeight();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(canvas);
        }
        canvas.restore();
    }
/**
     * Draw vertical list divider
     *
     * @param canvas canvas
     * @param parent RecyclerView
     */
Draw vertical list divider
@param canvas canvas
@param parent RecyclerView
Draw vertical list divider @param canvas canvas @param parent RecyclerView
private void drawVertical(Canvas canvas, RecyclerView parent) {
        canvas.save();
        final int left;
        final int right;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && parent.getClipToPadding()) {
            left = parent.getPaddingLeft() + mBuilder.mMarginLeft;
            right = parent.getWidth() - parent.getPaddingRight() - mBuilder.mMarginRight;
            canvas.clipRect(left, parent.getPaddingTop(), right, parent.getHeight() - parent.getPaddingBottom());
        } else {
            left = mBuilder.mMarginLeft;
            right = parent.getWidth() - mBuilder.mMarginRight;
        }
        int childCount = parent.getChildCount();
        int top;
        int bottom;
        int count = parent.getAdapter().getItemCount();
        for (int i = 0; i < childCount; i++) {
            final View child = parent.getChildAt(i);
            int position = parent.getChildAdapterPosition(child);
            if (needSkip(position, count)) {
                continue;
            }
            parent.getLayoutManager().getDecoratedBoundsWithMargins(child, mBounds);
            bottom = mBounds.bottom + Math.round(ViewCompat.getTranslationY(child));
            top = bottom - mDivider.getIntrinsicHeight();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(canvas);
        }
        if (childCount > 0 && mBuilder.mShowTopDivider) {
            final View child = parent.getChildAt(0);
            parent.getLayoutManager().getDecoratedBoundsWithMargins(child, mBounds);
            top = mBounds.top + Math.round(ViewCompat.getTranslationY(child));
            bottom = top + mDivider.getIntrinsicHeight();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(canvas);
        }
        canvas.restore();
    }
private void drawVertical ( Canvas canvas , RecyclerView parent ) { canvas . save ( ) ; final int left ; final int right ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP && parent . getClipToPadding ( ) ) { left = parent . getPaddingLeft ( ) + mBuilder . mMarginLeft ; right = parent . getWidth ( ) - parent . getPaddingRight ( ) - mBuilder . mMarginRight ; canvas . clipRect ( left , parent . getPaddingTop ( ) , right , parent . getHeight ( ) - parent . getPaddingBottom ( ) ) ; } else { left = mBuilder . mMarginLeft ; right = parent . getWidth ( ) - mBuilder . mMarginRight ; } int childCount = parent . getChildCount ( ) ; int top ; int bottom ; int count = parent . getAdapter ( ) . getItemCount ( ) ; for ( int i = 0 ; i < childCount ; i ++ ) { final View child = parent . getChildAt ( i ) ; int position = parent . getChildAdapterPosition ( child ) ; if ( needSkip ( position , count ) ) { continue ; } parent . getLayoutManager ( ) . getDecoratedBoundsWithMargins ( child , mBounds ) ; bottom = mBounds . bottom + Math . round ( ViewCompat . getTranslationY ( child ) ) ; top = bottom - mDivider . getIntrinsicHeight ( ) ; mDivider . setBounds ( left , top , right , bottom ) ; mDivider . draw ( canvas ) ; } if ( childCount > 0 && mBuilder . mShowTopDivider ) { final View child = parent . getChildAt ( 0 ) ; parent . getLayoutManager ( ) . getDecoratedBoundsWithMargins ( child , mBounds ) ; top = mBounds . top + Math . round ( ViewCompat . getTranslationY ( child ) ) ; bottom = top + mDivider . getIntrinsicHeight ( ) ; mDivider . setBounds ( left , top , right , bottom ) ; mDivider . draw ( canvas ) ; } canvas . restore ( ) ; }
Draw vertical list divider
 @param canvas canvas
 @param parent RecyclerView
Draw vertical list divider @param canvas canvas @param parent RecyclerView