package com.zj365.health.act

import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseListAct
import com.xty.common.arouter.ARouterUrl
import com.zj365.health.adapter.XyaRecordAdapter
import com.zj365.health.databinding.ActBloodStudyRecordBinding
import com.zj365.health.vm.XyVm
import com.zj365.health.weight.UnBindDialog

@Route(path = ARouterUrl.XUEYA_XUEXIJILU)
class BloodStudyRecordListAct : BaseListAct<XyVm>() {
    val binding  by lazy{ ActBloodStudyRecordBinding.inflate(layoutInflater)}
    var dialog: UnBindDialog?=null
    val mAdapter by lazy{ XyaRecordAdapter() }

    override fun initView() {
        super.initView()
        statusBar(binding.title.mView)
        binding.title.mIvBack.setOnClickListener { finish() }
        binding.title.mTvTitle.text = "血压学习"
    }



    override fun liveObserver() {
        mViewModel.recordList.observe(this) {
            mAdapter?.let { adapter ->
                mAdapter?.let { adapter ->
                    setDate(adapter, it.data)
                }
            }
        }

    }

    override fun setLayout()= binding.root
    override fun initAdapter() {
        setRecycleRefresh(binding.mRecycle,binding.mRefresh)
        binding.mRecycle.layoutManager= LinearLayoutManager(this)
        binding.mRecycle.adapter=mAdapter
        mAdapter?.setEmptyView(getNoneView())
    }

    override fun loadData() {
        mViewModel.getRecordList()
    }


}