package com.zj365.dc.weight

import android.content.Context
import android.text.Html
import com.xty.base.dialog.BaseDialog
import com.zj365.dc.databinding.DialogWearBinding

class WearDialog(context: Context,var confirm:()->Unit) : BaseDialog(context) {
    val binding by lazy { DialogWearBinding.inflate(layoutInflater) }
    override fun setLayout() = binding.root
    override fun initView() {
        super.initView()
        setDialogPadding(40, 0, 40, 0)
        setCanceledOnTouchOutside(false)
        setCancelable(false)
        binding.mTvConfirm.setOnClickListener {
            confirm.invoke()
            dismiss()
        }
    }

    fun showContent(  text:String){
        percentHeight=3/4f
        showDialog()
        binding.mContent.text=Html.fromHtml(text.trim().toString())


    }
}