package net.pokeranalytics.android.ui.adapter

import android.content.Context
import android.util.AttributeSet
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView
import net.pokeranalytics.android.R


class RowRepresentableRecyclerView : RecyclerView {
    /**
     * Constructors
     */
    constructor(context: Context) : super(context) {
        init()
    }

    constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
        init()
    }

    constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
        init()
    }

    /**
     * Init
     */
    private fun init() {
        val itemDecorator = DividerItemDecoration(this.context, DividerItemDecoration.VERTICAL)
        itemDecorator.setDrawable(ContextCompat.getDrawable(this.context!!, R.drawable.separator)!!)
        this.addItemDecoration(itemDecorator)
    }
}