package com.xty.base.weight

import android.content.Context
import android.view.View
import com.xty.base.databinding.DialogTipDeleteBinding
import com.xty.base.dialog.BaseDialog
import com.xty.common.SizeUtil

class DeleteDialog (context: Context, var title:String, var confirm:()->Unit,): BaseDialog(context) {
    val binding by lazy{ DialogTipDeleteBinding.inflate(layoutInflater)}
    override fun setLayout()=binding.root
    override fun initView() {
        super.initView()
        setDialogPadding(SizeUtil.dp2px(context,40f),0, SizeUtil.dp2px(context,40f),0)
        binding.mTitle.text = title

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