package com.test.basd.smartjunkcleaner.activity.photocompress.photo

import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.View
import android.widget.TextView

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

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

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

}
