package com.grkj.iscs_mc.view.fragment

import com.grkj.iscs_mc.R
import com.grkj.iscs_mc.databinding.FragmentMaterialReplacementBinding
import com.grkj.iscs_mc.extentions.navigateTo
import com.grkj.iscs_mc.extentions.navigateUp
import com.grkj.iscs_mc.view.base.BaseMvpFragment
import com.grkj.iscs_mc.view.iview.IMaterialReplacementView
import com.grkj.iscs_mc.view.presenter.MaterialReplacementPresenter
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder

/**
 * 物资管理 - 物资更换
 */
class MaterialReplacementFragment :
    BaseMvpFragment<IMaterialReplacementView, MaterialReplacementPresenter, FragmentMaterialReplacementBinding>() {

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

    override fun initView() {
        mBinding?.cbBack?.setOnClickListener { navigateUp() }

        mBinding?.rvMaterial?.adapter = object :
            CommonAdapter<String>(requireContext(), R.layout.item_rv_replacement, mutableListOf()) {
            override fun convert(holder: ViewHolder, t: String, position: Int) {

            }
        }

        navigateTo(MaterialReplacementFragmentDirections.actionReplacementFragmentToManualReplacementFragment())
    }

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