package com.zj365.dc.activity

import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.BaseVmAct
import com.xty.base.vm.BaseVm
import com.xty.common.arouter.ARouterUrl
import com.zj365.dc.databinding.ActWatchFamilyHealthBinding
import com.zj365.dc.fragment.DynamicManagementFrag

@Route(path = ARouterUrl.WATCH_FAMILY_HEALTH)
class WatchFamilyHealthAct : BaseVmAct<BaseVm>() {

    val binding by lazy { ActWatchFamilyHealthBinding.inflate(layoutInflater) }

    var showIdInfo = ""
    override fun liveObserver() {
    }

    override fun initView() {
        super.initView()
        statusBar(binding.title.mView)
        binding.title.mTvTitle.text ="健康监测"
        binding.title.mIvBack.setOnClickListener {
            finish()
        }

        showIdInfo = intent.extras!!.getString("id","")

        supportFragmentManager.beginTransaction().replace(binding.container.id, setArgumentFrag(DynamicManagementFrag(),showIdInfo)).commit()
    }

    private fun setArgumentFrag(frag: Fragment, id: String = ""): Fragment {
        val bundle = Bundle()
        bundle.putString("id", id)
        frag.arguments = bundle
        return frag
    }

    override fun setLayout() = binding.root
}