package com.grkj.iscs_mc.view.fragment

import com.grkj.iscs_mc.R
import com.grkj.iscs_mc.databinding.FragmentExceptionHandleBinding
import com.grkj.iscs_mc.view.base.BaseMvpFragment
import com.grkj.iscs_mc.view.iview.IExceptionHandleView
import com.grkj.iscs_mc.view.presenter.ExceptionHandlePresenter
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder

/**
 * 异常处理页
 */
class ExceptionHandleFragment :
    BaseMvpFragment<IExceptionHandleView, ExceptionHandlePresenter, FragmentExceptionHandleBinding>() {

    override val viewBinding: FragmentExceptionHandleBinding
        get() = FragmentExceptionHandleBinding.inflate(layoutInflater)

    override fun initView() {
        mBinding?.rvException?.adapter = object :
            CommonAdapter<String>(requireContext(), R.layout.item_rv_exception, mutableListOf()) {
            override fun convert(holder: ViewHolder, t: String, position: Int) {
                val recyclerView =
                    holder.getView<androidx.recyclerview.widget.RecyclerView>(R.id.rv_exception_item)
                recyclerView.adapter = object :
                    CommonAdapter<String>(
                        requireContext(),
                        R.layout.item_rv_exception_item,
                        mutableListOf()
                    ) {
                    override fun convert(holder: ViewHolder, t: String, position: Int) {

                    }
                }
            }
        }
    }

    override fun initPresenter(): ExceptionHandlePresenter {
        return ExceptionHandlePresenter()
    }
}