package com.halo.assistant.fragment.user

import android.content.Context
import android.os.Bundle
import com.gh.gamecenter.common.base.TrackableDialog
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.databinding.DialogVerifiedConfirmBinding

class VerifiedConfirmDialog(val mContext: Context, private val mEvent: String, private val mKey: String) :
    TrackableDialog(mContext, com.gh.gamecenter.common.R.style.DialogWindowTransparent, mEvent, mKey) {

    var onConfirmClickListener: (() -> Unit)? = null
    private val mBinding: DialogVerifiedConfirmBinding by lazy { DialogVerifiedConfirmBinding.inflate(layoutInflater) }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(mBinding.root)
        mBinding.dialogCancel.setOnClickListener {
            MtaHelper.onEvent(mEvent, mKey, "点击取消")
            dismiss()
        }
        mBinding.dialogConfirm.setOnClickListener {
            MtaHelper.onEvent(mEvent, mKey, "点击确定")
            onConfirmClickListener?.invoke()
            dismiss()
        }
    }
}