package mtp.polymer.com.autowidget.adapter

import androidx.lifecycle.MutableLiveData
import android.content.Context
import com.chad.library.adapter.base.BaseViewHolder
import org.jetbrains.anko._FrameLayout


abstract class BaseViewHolder<T> constructor(context: Context) : BaseViewHolder(_FrameLayout(context)) {

    val data: MutableLiveData<T> = MutableLiveData()

    var dataIndex: Int = -1

    var dataCount: Int = 0

    abstract val itemSize: IntArray

    internal fun createContent() {
        (itemView as? _FrameLayout)?.createContentView()
    }

    abstract fun _FrameLayout.createContentView()

}