package pxds.dlpf.buoz.fico

import android.view.Gravity
import android.view.ViewGroup
import android.widget.PopupWindow
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.updatePadding
import com.blankj.utilcode.util.BarUtils
import com.test.basd.supercleanermax.R
import com.test.basd.supercleanermax.databinding.EgbldjBinding
import pxds.lmmd.zmwf.Khko.setTrackedOnClickListener
import pxds.lmmd.zmwf.Khko.string

class Vxpy(private val activity: AppCompatActivity, val onClick: () -> Unit) : PopupWindow() {

    private val binding by lazy {
        EgbldjBinding.inflate(activity.layoutInflater)
    }

    override fun dismiss() {
        super.dismiss()
        BarUtils.setStatusBarLightMode(activity, true)
    }

    fun show() {
        contentView = binding.root
        activity.window.decorView.post {
            binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
            BarUtils.setStatusBarLightMode(activity, false)
            showAtLocation(activity.window.decorView, Gravity.BOTTOM, 0, 100)
        }
        binding.ohofdbh.imageAssetsFolder = R.string.ނލޚށދ_D.string()
        binding.ohofdbh.setAnimation(R.string.ޛގޘލޚ_D.string())
        binding.ohofdbh.playAnimation()
        binding.tlqjmwq.setTrackedOnClickListener {
            dismiss()
            onClick.invoke()
        }
        binding.hhejwao.setTrackedOnClickListener {
            dismiss()
            onClick.invoke()
        }

    }

    init {
        width = ViewGroup.LayoutParams.MATCH_PARENT
        height = ViewGroup.LayoutParams.MATCH_PARENT

        isOutsideTouchable = false
        isFocusable = true
        isClippingEnabled = false
    }
}