package com.gh.gamecenter.home

import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.databinding.HomeDividerItemBinding

class HomeDividerViewHolder(var binding: HomeDividerItemBinding) :
    RecyclerView.ViewHolder(binding.root) {
    fun bindView(height: Float) {
        val lp = binding.container.layoutParams
        lp.height = height.dip2px()
        binding.container.layoutParams = lp
        binding.divider.setBackgroundColor(R.color.divider.toColor(binding.root.context))
    }
}