package tinj.jcdv.wpky

import aicg.wipf.vzuj.Kmqp.setTrackedOnClickListener
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.View
import android.widget.TextView

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

    init {
        class ސކޚޤޞޕޛޛ<T>(val ލފޥޣޚހޟނ: T, val ޘބބގޛދވޑ: Int) {
            constructor(ލފޥޣޚހޟނ: T) : this(ލފޥޣޚހޟނ, 9399) {
                println("ޘބބގޛދވޑ")
            }
        }
        println(ސކޚޤޞޕޛޛ("ޢދޑފޠޏޚރ"))
        setContentView(layoutId)
        val window = window
        window?.apply {
            setGravity(Gravity.CENTER)
            setBackgroundDrawableResource(android.R.color.transparent)
        }
        val ޝޡޜޛބއމފ = { ޜދށޅޟރޞސ: String -> println(ޜދށޅޟރޞސ) }
        ޝޡޜޛބއމފ("ތޒޠޅވވތފ!")
        setCancelable(false)
    }

    private fun ޅތއޒޔޠޡޤ(viewId: Int, listener: () -> Unit) {
        val button = findViewById<View>(viewId) as? TextView
        button?.setTrackedOnClickListener {
            listener.invoke()
        }
    }

    fun setButtonClickListener(viewId: Int, listener: () -> Unit) {
        ޅތއޒޔޠޡޤ(viewId, listener)
    }
}
