// Path: omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/item_decoration/BaseSpaceItemDecoration.java
// public class BaseSpaceItemDecoration extends BaseItemDecoration {
// 
//     private final int mItemSpace;
// 
//     public BaseSpaceItemDecoration(int showDivider, int space) {
//         super(showDivider);
//         mItemSpace = space;
//     }
// 
//     @Override
//     void getItemOffset(@NonNull Rect outRect, @NonNull RecyclerView parent,
//                        @NonNull DividerDecorationHelper helper, int position, int itemCount) {
//         int countBeginEndPositions = getCountBeginEndPositions(parent);
//         int itemSpace = getItemSpace(parent, position, itemCount);
// 
//         if (isShowBeginDivider() || countBeginEndPositions <= position) helper.setStart(outRect, itemSpace);
//         if (isShowEndDivider() && position == itemCount - countBeginEndPositions) helper.setEnd(outRect, itemSpace);
// 
//         if (countBeginEndPositions > 1) {
//             if (position % countBeginEndPositions != 0 || isShowBeginDivider()) helper.setOtherStart(outRect, itemSpace);
//             if (position / (countBeginEndPositions - 1) > 0 && isShowEndDivider()) helper.setOtherEnd(outRect, itemSpace);
//         }
//     }
// 
//     protected int getItemSpace(@NonNull RecyclerView parent, int position, int itemCount) {
//         return mItemSpace;
//     }
// 
//     private int getCountBeginEndPositions(RecyclerView recyclerView) {
//         RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
//         if (layoutManager instanceof GridLayoutManager) {
//             return ((GridLayoutManager) layoutManager).getSpanCount();
//         } else return 1;
//     }
// 
// }
// 
// Path: omegarecyclerview_expandable/src/main/java/com/omega_r/libs/omegarecyclerview_expandable/OmegaExpandableRecyclerView.java
// static final int VH_TYPE_CHILD = 238957;
// 
// Path: omegarecyclerview_expandable/src/main/java/com/omega_r/libs/omegarecyclerview_expandable/OmegaExpandableRecyclerView.java
// static final int VH_TYPE_GROUP = 238956;


import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.omega_r.libs.omegarecyclerview.item_decoration.BaseSpaceItemDecoration;
import static com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView.Adapter.VH_TYPE_CHILD;
import static com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView.Adapter.VH_TYPE_GROUP;
package com.omega_r.libs.omegarecyclerview_expandable;




@SuppressWarnings("rawtypes")
public class ExpandableSpaceItemDecoration extends BaseSpaceItemDecoration {

    private int mGroupItemSpace = 0;

    public ExpandableSpaceItemDecoration(int showDivider, int itemSpace) {
        super(showDivider, itemSpace);
    }

    public void setGroupSpace(int groupSpace) {
        mGroupItemSpace = groupSpace;
    }

    @Override
    protected int getItemSpace(@NonNull RecyclerView parent, int position, int itemCount) {
        RecyclerView.Adapter adapter = parent.getAdapter();
        if (adapter == null) return super.getItemSpace(parent, position, itemCount);

        int viewType = adapter.getItemViewType(position);
        switch (viewType) {
            case VH_TYPE_GROUP:
                return mGroupItemSpace;
// Path: omegarecyclerview/src/main/java/com/omega_r/libs/omegarecyclerview/item_decoration/BaseSpaceItemDecoration.java
// public class BaseSpaceItemDecoration extends BaseItemDecoration {
// 
//     private final int mItemSpace;
// 
//     public BaseSpaceItemDecoration(int showDivider, int space) {
//         super(showDivider);
//         mItemSpace = space;
//     }
// 
//     @Override
//     void getItemOffset(@NonNull Rect outRect, @NonNull RecyclerView parent,
//                        @NonNull DividerDecorationHelper helper, int position, int itemCount) {
//         int countBeginEndPositions = getCountBeginEndPositions(parent);
//         int itemSpace = getItemSpace(parent, position, itemCount);
// 
//         if (isShowBeginDivider() || countBeginEndPositions <= position) helper.setStart(outRect, itemSpace);
//         if (isShowEndDivider() && position == itemCount - countBeginEndPositions) helper.setEnd(outRect, itemSpace);
// 
//         if (countBeginEndPositions > 1) {
//             if (position % countBeginEndPositions != 0 || isShowBeginDivider()) helper.setOtherStart(outRect, itemSpace);
//             if (position / (countBeginEndPositions - 1) > 0 && isShowEndDivider()) helper.setOtherEnd(outRect, itemSpace);
//         }
//     }
// 
//     protected int getItemSpace(@NonNull RecyclerView parent, int position, int itemCount) {
//         return mItemSpace;
//     }
// 
//     private int getCountBeginEndPositions(RecyclerView recyclerView) {
//         RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
//         if (layoutManager instanceof GridLayoutManager) {
//             return ((GridLayoutManager) layoutManager).getSpanCount();
//         } else return 1;
//     }
// 
// }
// 
// Path: omegarecyclerview_expandable/src/main/java/com/omega_r/libs/omegarecyclerview_expandable/OmegaExpandableRecyclerView.java
// static final int VH_TYPE_CHILD = 238957;
// 
// Path: omegarecyclerview_expandable/src/main/java/com/omega_r/libs/omegarecyclerview_expandable/OmegaExpandableRecyclerView.java
// static final int VH_TYPE_GROUP = 238956;


// Path: omegarecyclerview_expandable/src/main/java/com/omega_r/libs/omegarecyclerview_expandable/ExpandableSpaceItemDecoration.java
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.omega_r.libs.omegarecyclerview.item_decoration.BaseSpaceItemDecoration;
import static com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView.Adapter.VH_TYPE_CHILD;
import static com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView.Adapter.VH_TYPE_GROUP;

package com.omega_r.libs.omegarecyclerview_expandable;




@SuppressWarnings("rawtypes")
public class ExpandableSpaceItemDecoration extends BaseSpaceItemDecoration {

    private int mGroupItemSpace = 0;

    public ExpandableSpaceItemDecoration(int showDivider, int itemSpace) {
        super(showDivider, itemSpace);
    }

    public void setGroupSpace(int groupSpace) {
        mGroupItemSpace = groupSpace;
    }

    @Override
    protected int getItemSpace(@NonNull RecyclerView parent, int position, int itemCount) {
        RecyclerView.Adapter adapter = parent.getAdapter();
        if (adapter == null) return super.getItemSpace(parent, position, itemCount);

        int viewType = adapter.getItemViewType(position);
        switch (viewType) {
            case VH_TYPE_GROUP:
                return mGroupItemSpace;
            case VH_TYPE_CHILD: