package com.zj365.health.act

import android.text.Html
import android.text.method.LinkMovementMethod
import com.alibaba.android.arouter.facade.annotation.Route
import com.xty.base.act.IBaseAct
import com.xty.common.MyImageGetter
import com.xty.common.MyTagHandler
import com.xty.common.arouter.ARouterUrl
import com.zj365.health.databinding.ActXdInfoDescBinding
import com.xty.network.model.XdBean


/**
 * 心电描述
 */
@Route(path = ARouterUrl.XD_INFO)
class XdInfoAct: IBaseAct() {
    val binding by lazy{ ActXdInfoDescBinding.inflate(layoutInflater)}
    override fun setLayout()=binding.root
    override fun initData() {
        super.initData()
        isDarkBar=true
        var msg=intent.extras!!.getSerializable("bean") as XdBean
        binding.mMsg.setMovementMethod(LinkMovementMethod.getInstance()) // 重点
        var getter=MyImageGetter(this,binding.mMsg)
        var handler= MyTagHandler(this)

        binding.mMsg.text=Html.fromHtml(msg.content,getter,handler)

        binding.title.mTvTitle.text=msg.name
    }

    override fun initView() {
        super.initView()
        statusBar(binding.title.mView)
        binding.title.mIvBack.setOnClickListener { finish() }
    }
}