package com.zj365.mime.adapter
import android.widget.EditText
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.mime.R
import com.zj365.mime.model.SportAdd

class ChildSportAdapter: BaseAdapter<SportAdd.Group>(R.layout.item_child_sport) {
    var mapView= LinkedHashMap<Int,MutableList<EditText>>()
    init {
        mapView.clear()
    }
    override fun convert(holder: BaseViewHolder, item: SportAdd.Group) {
       // holder.setText(R.id.mGroupTitle,"第${holder.layoutPosition+1}组")
        holder.setGone(R.id.mAdd,holder.layoutPosition+1!=itemCount)
        holder.setGone(R.id.mDelete,itemCount==1)
       var v1= holder.getView<EditText>(R.id.mV1).apply { setText(item.dataValue1) }
        var v2=holder.getView<EditText>(R.id.mV2).apply{setText(item.dataValue2)}

        var list= mutableListOf(v1,v2)
        mapView[holder.layoutPosition] = list
    }
}