package fsir.tqqe

import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.View
import android.widget.TextView
import pxds.lmmd.zmwf.Khko.setTrackedOnClickListener

class Byfg(context: Context, layoutId: Int) : Dialog(context) {

    fun setButtonClickListener(viewId: Int, listener: () -> Unit) {
        val button = findViewById<View>(viewId) as? TextView
        button?.setTrackedOnClickListener {
            listener.invoke()
        }
    }

    init {
        setContentView(layoutId)
        val window = window
        window?.apply {
            setGravity(Gravity.CENTER)
            setBackgroundDrawableResource(android.R.color.transparent)
        }
        setCancelable(false)
    }
}
