package com.zj365.mime.adapter

import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xty.base.adapter.BaseAdapter
import com.zj365.mime.R
import com.xty.network.model.ScoreBean

class ScroeAdapter:BaseAdapter<MutableList<ScoreBean.Records>>(R.layout.item_score) {
    override fun convert(holder: BaseViewHolder, item: MutableList<ScoreBean.Records>) {
        holder.setText(R.id.mTime,item[0].createTime.substring(0,10))
        //holder.setText(R.id.mAllScore,"积分：$allNum")

        var view=holder.getView<RecyclerView>(R.id.mRecycle)
        initAdapter(view,item)
    }

    private fun initAdapter(recycle:RecyclerView,value:MutableList<ScoreBean.Records>) {
        var adapter=ScoreChildAdapter()
        recycle.adapter=adapter
        recycle.layoutManager=LinearLayoutManager(context)
        adapter.setNewInstance(value)

    }
}