package com.danding.yang800.General;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by Administrator on 2017/6/27.
 */
public class SpaceItemDecoration extends RecyclerView.ItemDecoration {
    int space;

    public SpaceItemDecoration(int space) {
        this.space = space;
    }

    public void getItemOffsets(Rect outRect, View view,
                               RecyclerView parent, RecyclerView.State state) {
        if (parent.getChildPosition(view) != 0)
            outRect.left = space;
    }
}
