package pxds.dlpf.buoz.fico

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import com.test.basd.supercleanermax.R
import com.test.basd.supercleanermax.databinding.ZaewrkBinding
import pxds.lmmd.zmwf.Khko.setTrackedOnClickListener

object Yung {

    fun Context.showPermissionFilterDialog(
        allClick: () -> Unit, authorizedClick: () -> Unit, ) {
        val binding = ZaewrkBinding.inflate(LayoutInflater.from(this))
        val dialog = AlertDialog.Builder(this).setView(binding.root).create()

        dialog.setContentView(binding.root)
        dialog.setCanceledOnTouchOutside(true)
        dialog.show()

        val lp = dialog.window?.attributes
        lp?.width = resources.getDimensionPixelOffset(R.dimen.ޤޗޔޏޛ)
        lp?.height = ViewGroup.LayoutParams.WRAP_CONTENT
        dialog.window?.attributes = lp
        dialog.window?.setBackgroundDrawableResource(android.R.color.transparent)

        binding.tdnxtef.setTrackedOnClickListener {
            dialog.dismiss()
            allClick.invoke()
        }
        binding.gkscgyg.setTrackedOnClickListener {
            dialog.dismiss()
            authorizedClick.invoke()
        }
    }
}