package com.adealink.weparty.commonui.recycleview

import android.content.Context
import android.graphics.drawable.GradientDrawable
import androidx.recyclerview.widget.DividerItemDecoration
import com.adealink.weparty.commonui.drawabletoolbox.DrawableBuilder

/**
 * 自定义分割线颜色+高度
 */
class CustomDividerItemDecoration(
    context: Context?, orientation: Int
) : DividerItemDecoration(context, orientation) {

    fun setDivider(dividerHeight: Int, dividerColor: Int) {
        val dividerDrawable = DrawableBuilder()
            .shape(GradientDrawable.RECTANGLE)
            .solidColor(dividerColor)
            .height(dividerHeight)
            .build()
        setDrawable(dividerDrawable)
    }

}