package com.xty.base.dialog

import android.content.Context
import android.view.ViewGroup
import com.xty.base.databinding.DialogMicBinding

class MIcDialog (context: Context, var confirm:()->Unit,var cancel:()->Unit): BaseDialog(context) {
    val binding by lazy{DialogMicBinding.inflate(layoutInflater)}
    override fun setLayout()=binding.root
    override fun initView() {
        super.initView()
        setCanceledOnTouchOutside(false)
        setCancelable(false)
        window?.let {
            val attributes = it.attributes
            attributes.width=ViewGroup.LayoutParams.MATCH_PARENT
            attributes.height=ViewGroup.LayoutParams.MATCH_PARENT
            it.attributes=attributes

        }

        binding.mTvConfirm.setOnClickListener {
            dismiss()
            confirm.invoke()

        }
        binding.mTvCancel.setOnClickListener {
            cancel.invoke()
            dismiss()
        }
    }
}