package pxds.etmo.lexn.ylyy

import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.text.SpannableString
import android.text.Spanned
import android.text.style.UnderlineSpan
import androidx.core.view.isVisible
import com.test.basd.supercleanermax.R
import com.test.basd.supercleanermax.databinding.AfqrlyBinding
import pxds.Tmuv
import pxds.lmmd.zmwf.Khko.setTrackedOnClickListener
import pxds.lmmd.zmwf.Khko.string
import pxds.lmmd.zmwf.Uawv
import pxds.lmmd.zmwf.Wspd

class Rwze {

    private val binding: AfqrlyBinding

    private val context: Activity

    private val listener: onUserPrivacyAggreementListener

    interface onUserPrivacyAggreementListener {
        fun onAgreePrivacy()
    }

    private fun initView() {

        val spannableString = SpannableString(R.string.މޙޙޞޚ_D.string())
        spannableString.setSpan(
            UnderlineSpan(), 0, spannableString.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
        )
        binding.lklnqhj.text = spannableString

        binding.lklnqhj.setTrackedOnClickListener {
            val intent = Intent(
                Intent.ACTION_VIEW, Uri.parse(R.string.ވޤޥޚހ_D.string())
            )
            context.startActivity(intent)
        }

        binding.zifgydy.setTrackedOnClickListener {
            binding.zifgydy.isVisible = false
            binding.hilwkxt.isVisible = true
            binding.tkhqynm.isVisible = false
            Uawv.ifAgreePrivacy = true
            (context.application as Tmuv).initApp()
            Wspd.event(R.string.ޤޣސޜޘ_D.string())
            Wspd.event(R.string.ޟޝޙޡމ_D.string((javaClass.simpleName).toString()))
            listener.onAgreePrivacy()
        }
    }

    constructor(binding: AfqrlyBinding, context: Activity, listener: onUserPrivacyAggreementListener) {
        this.binding = binding
        this.context = context
        this.listener = listener
        initView()
    }
}