package com.zxhl.cms.widget;

import android.graphics.Rect;
import android.util.Log;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

import java.util.HashMap;

public class RecyclerViewSpacesItemDecoration2 extends RecyclerView.ItemDecoration {

    public RecyclerViewSpacesItemDecoration2() {
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        Log.d("wxw", "adapterPos" + parent.getChildAdapterPosition(view));
        Log.d("wxw", "layoutPos" + parent.getChildLayoutPosition(view));
        int pos = parent.getChildAdapterPosition(view);
        if (pos > 1) {
            if (pos % 2 == 0) {
                outRect.left = 40;
            }else {
                outRect.right = 40;
            }
        }

    }
}
