package com.xty.base.dialog

import android.content.Context
import com.xty.base.databinding.CustomDialogBinding

class CustomDialog(context: Context, var title: String, var content:String, var confirm:()->Unit, var cancel:()->Unit): BaseDialog(context) {
    val binding by lazy{CustomDialogBinding.inflate(layoutInflater)}
    override fun setLayout()=binding.root
    override fun initView() {
        super.initView()
        setDialogPadding(40,0,40,0)
        binding.mTitle.text=title
        binding.mContent.text = content
        binding.mTvConfirm.setOnClickListener {
            confirm.invoke()
            dismiss()
        }
        binding.mTvCancel.setOnClickListener {
            cancel.invoke()
            dismiss()
        }

        setOnCancelListener {
            cancel.invoke()
            dismiss()
        }
    }
}