package com.gdtlib.lib.viewholder

import android.view.View
import androidx.recyclerview.widget.RecyclerView

abstract class AbstractViewHolder<T : Any>(
    view: View,
    private val listener: OnClickListener?
) : RecyclerView.ViewHolder(view){

    init {
        itemView.setOnClickListener {
            listener?.onClick(adapterPosition)
        }
    }

    interface OnClickListener {
        fun onClick(position: Int)
    }

    abstract fun bindView(item: T)

}