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

        int childCount = parent.getChildCount();
        int left;
        int right;
        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);
            right = mBounds.right + Math.round(ViewCompat.getTranslationX(child));
            left = right - mDivider.getIntrinsicWidth();
            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);
            left = mBounds.left + Math.round(ViewCompat.getTranslationX(child));
            right = left + mDivider.getIntrinsicWidth();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(canvas);
        }
        canvas.restore();
    }
/**
     * Draw horizontal list divider
     *
     * @param canvas canvas
     * @param parent RecyclerView
     */
Draw horizontal list divider
@param canvas canvas
@param parent RecyclerView
Draw horizontal list divider @param canvas canvas @param parent RecyclerView
private void drawHorizontal(Canvas canvas, RecyclerView parent) {
        canvas.save();
        final int top;
        final int bottom;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && parent.getClipToPadding()) {
            top = parent.getPaddingTop() + mBuilder.mMarginTop;
            bottom = parent.getHeight() - parent.getPaddingBottom() - mBuilder.mMarginBottom;
            canvas.clipRect(parent.getPaddingLeft(), top, parent.getWidth() - parent.getPaddingRight(), bottom);
        } else {
            top = mBuilder.mMarginTop;
            bottom = parent.getHeight() - mBuilder.mMarginBottom;
        }
        int childCount = parent.getChildCount();
        int left;
        int right;
        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);
            right = mBounds.right + Math.round(ViewCompat.getTranslationX(child));
            left = right - mDivider.getIntrinsicWidth();
            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);
            left = mBounds.left + Math.round(ViewCompat.getTranslationX(child));
            right = left + mDivider.getIntrinsicWidth();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(canvas);
        }
        canvas.restore();
    }
private void drawHorizontal ( Canvas canvas , RecyclerView parent ) { canvas . save ( ) ; final int top ; final int bottom ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP && parent . getClipToPadding ( ) ) { top = parent . getPaddingTop ( ) + mBuilder . mMarginTop ; bottom = parent . getHeight ( ) - parent . getPaddingBottom ( ) - mBuilder . mMarginBottom ; canvas . clipRect ( parent . getPaddingLeft ( ) , top , parent . getWidth ( ) - parent . getPaddingRight ( ) , bottom ) ; } else { top = mBuilder . mMarginTop ; bottom = parent . getHeight ( ) - mBuilder . mMarginBottom ; } int childCount = parent . getChildCount ( ) ; int left ; int right ; 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 ) ; right = mBounds . right + Math . round ( ViewCompat . getTranslationX ( child ) ) ; left = right - mDivider . getIntrinsicWidth ( ) ; 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 ) ; left = mBounds . left + Math . round ( ViewCompat . getTranslationX ( child ) ) ; right = left + mDivider . getIntrinsicWidth ( ) ; mDivider . setBounds ( left , top , right , bottom ) ; mDivider . draw ( canvas ) ; } canvas . restore ( ) ; }
Draw horizontal list divider
 @param canvas canvas
 @param parent RecyclerView
Draw horizontal list divider @param canvas canvas @param parent RecyclerView