package pxds.dlpf.buoz.fico

import android.app.Dialog
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.LayoutInflater
import com.blankj.utilcode.util.ClickUtils
import com.blankj.utilcode.util.SpanUtils
import com.test.basd.supercleanermax.R
import com.test.basd.supercleanermax.databinding.CqltboBinding
import com.test.basd.supercleanermax.databinding.RiyhzsBinding
import pxds.lmmd.zmwf.Khko.setTrackedOnClickListener
import pxds.lmmd.zmwf.Khko.string

object Ohyk {

    fun showBothTypes(context: Context, onClick: (potion: Int) -> Unit) {
        val dialog = Dialog(context)
        val binding = RiyhzsBinding.inflate(LayoutInflater.from(context))
        dialog.requestWindowFeature(1)
        dialog.window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        dialog.window!!.setLayout(-1, -1)
        dialog.setCanceledOnTouchOutside(true)
        dialog.setCancelable(true)
        dialog.setContentView(binding.root)
        ClickUtils.applyPressedBgDark(binding.ndxmrrr)
        ClickUtils.applyPressedBgDark(binding.phvxngn)
        ClickUtils.applyPressedBgDark(binding.yaxyzck)
        binding.ndxmrrr.setTrackedOnClickListener {
            onClick(0)
            dialog.dismiss()
        }
        binding.phvxngn.setTrackedOnClickListener {
            onClick(1)
            dialog.dismiss()
        }
        binding.yaxyzck.setTrackedOnClickListener {
            onClick(2)
            dialog.dismiss()
        }

        dialog.show()
    }

    fun showGerPermission(context: Context, onClose: (view: Dialog) -> Unit, onClose2: (view: Dialog) -> Unit?):Dialog {
        val dialog = Dialog(context)
        val binding = CqltboBinding.inflate(LayoutInflater.from(context))
        dialog.requestWindowFeature(1)
        dialog.window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        dialog.window!!.setLayout(-1, -1)
        dialog.setCanceledOnTouchOutside(false)
        dialog.setCancelable(false)
        dialog.setContentView(binding.root)
        val str=context.resources.getString(R.string.ނޑޕޝދ)
        SpanUtils.with(binding.iqmpzym)
            .append(R.string.ޒފޑބޔ_D.string((str).toString()))
            .setFontSize(13, true)
            .setForegroundColor(0xFF999999.toInt())
            .append(R.string.ޝލޏޞޕ_D.string())
            .setBold()
            .setFontSize(13, true)
            .setForegroundColor(0xFF4273FF.toInt())
            .append(R.string.ޥފޔޤކ_D.string())
            .setFontSize(13, true)
            .setForegroundColor(0xFF999999.toInt())
            .create()
        binding.nnfozvv.imageAssetsFolder = R.string.ޡމދޅޝ_D.string()
        binding.nnfozvv.setAnimation(R.string.ޚޅޡފޏ_D.string())
        binding.nnfozvv.playAnimation()
        binding.roarmjl.setTrackedOnClickListener {
            dialog.dismiss()
            onClose2.invoke(dialog)
        }
        binding.vxifxzy.setTrackedOnClickListener {
            dialog.dismiss()
            onClose.invoke(dialog)
        }
        dialog.show()
        return dialog
    }
}