//package rowedto.jockeyedto.sheetedto.atticedto
//
//import android.annotation.SuppressLint
//import android.content.Intent
//import android.graphics.Color
//import android.net.Uri
//import android.text.SpannableString
//import android.text.Spanned
//import android.text.style.UnderlineSpan
//import android.view.View
//import androidx.lifecycle.lifecycleScope
//import rowedto.jockeyedto.sheetedto.Epicalyxedto
//import rowedto.jockeyedto.sheetedto.atticedto.appmanager.AppManagerAnimationActivity
//import rowedto.jockeyedto.sheetedto.atticedto.appprocess.AppProcessAnimationActivity
//import rowedto.jockeyedto.sheetedto.atticedto.peakedto.affinityedto.jacketedto.Scrapedto
//import rowedto.jockeyedto.sheetedto.atticedto.roleedto.verticaledto.routeedto.Sailedto
//import rowedto.jockeyedto.sheetedto.atticedto.directionedto.noxiousedto.batedto.Celebrationedto
//import rowedto.jockeyedto.sheetedto.atticedto.rededto.knifeedto.economyedto.Restrictedto
//import rowedto.jockeyedto.sheetedto.atticedto.rededto.knifeedto.economyedto.Viableedto
//import rowedto.jockeyedto.sheetedto.atticedto.expandedto.colonyedto.dietedto.Successedto
//import rowedto.jockeyedto.sheetedto.atticedto.harboredto.Poemedto
//import rowedto.jockeyedto.sheetedto.atticedto.harboredto.Reignedto
//import rowedto.jockeyedto.sheetedto.atticedto.strainedto.wolfedto.furtheredto.Archiveedto
//import rowedto.jockeyedto.sheetedto.atticedto.whatsapp.WhatsAppCleanerAnimationActivity
//import rowedto.jockeyedto.sheetedto.strangeedto.pyramidedto.particlesedto.Scandaledto
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_APP_MANAGER
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_APP_PROCESS
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_BATTERY_INFO
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_JUNK_CLEAN_PUSH
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_LARGE_FILE
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_PRIVACY_SPACE
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_RECOVERY_DOCUMENTS
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_RECOVERY_PHOTOS
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_RECOVERY_VIDEOS
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_SCREENSHOT_CLEAN
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_SIMILAR_IMAGE
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ID_WHATSAPP_CLEANER
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.ifAgreePrivacy
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.isGuide
//import rowedto.jockeyedto.sheetedto.debutedto.revolutionaryedto.Dynamicedto.privacyPinPassword
//import com.base.datarecovery.databinding.YogaedtoBinding
//import rowedto.jockeyedto.sheetedto.interactiveedto.twistedto.Easilyedto
//import rowedto.jockeyedto.sheetedto.interactiveedto.twistedto.Easilyedto.Companion.NotificationId
//import rowedto.jockeyedto.sheetedto.interactiveedto.twistedto.Sectoredto
//import rowedto.jockeyedto.sheetedto.knewedto.economicedto.copyrightedto.Crossingedto
//import rowedto.jockeyedto.sheetedto.knewedto.economicedto.copyrightedto.Celledto
//import rowedto.jockeyedto.sheetedto.dryedto.stableedto.Surfaceedto.Companion.startStayNotification
//import rowedto.jockeyedto.sheetedto.raceedto.pavementedto.Stewardedto
//import rowedto.jockeyedto.sheetedto.raceedto.pavementedto.Spareedto
//import rowedto.jockeyedto.sheetedto.raceedto.pavementedto.Dishedto
//import kotlinx.coroutines.Dispatchers
//import kotlinx.coroutines.Job
//import kotlinx.coroutines.cancel
//import kotlinx.coroutines.delay
//import kotlinx.coroutines.flow.MutableSharedFlow
//import kotlinx.coroutines.flow.SharedFlow
//import kotlinx.coroutines.flow.collectLatest
//import kotlinx.coroutines.isActive
//import kotlinx.coroutines.launch
//import kotlin.random.Random
//
//@SuppressLint("CustomSplashScreen")
//class Reliefedto : Crossingedto<YogaedtoBinding>() {
//
//    private val TAG = "SplashActivity"
//    private var job: Job? = null
//    private val progress = MutableSharedFlow<Int>()
//    private val progressFlow: SharedFlow<Int> = progress
//    private var oneClickStart: Boolean = false
//    private var actionId = -1
//
//
//    override val binding: YogaedtoBinding by lazy {
//        YogaedtoBinding.inflate(layoutInflater)
//    }
//
//    override fun initView() {
//        Spareedto.setStatusBarLightMode(this, true)
//        Spareedto.setStatusBarColor(this, Color.TRANSPARENT)
//
////        if (Epicalyxedto.isInterOpenShowing) {
////            finish()
////            return
////        }
//
//        startStayNotification()
//        Sectoredto.stopNotificationHandler()
//
//        actionId = intent?.extras?.getInt("actionId") ?: -1
//        closeNotification()
//
//        progressCollect()
//
//        if (ifAgreePrivacy) {
//            Dishedto.logDebug(TAG, "ifAgreePrivacy=$ifAgreePrivacy")
//
//            Scandaledto.preloadAd(this)
//
//            job = startProgress()
//            binding.offeredto.visibility = View.GONE
//            binding.rainbowedto.visibility = View.VISIBLE
//        } else {
//            binding.offeredto.visibility = View.VISIBLE
//            binding.rainbowedto.visibility = View.GONE
//        }
//
//        val spannableString = SpannableString("Privacy Policy")
//        spannableString.setSpan(
//            UnderlineSpan(),
//            0,
//            spannableString.length,
//            Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
//        )
//        binding.inspirationedto.text = spannableString
//
//        binding.inspirationedto.setOnClickListener {
//            val intent = Intent(
//                Intent.ACTION_VIEW,
//                Uri.parse(Celledto.privacyPolicy)
//            )
//            startActivity(intent)
//        }
//
//
//    }
//
//    private fun progressCollect() {
//        lifecycleScope.launch {
//            progressFlow.collectLatest {
//                if (it >= 100) {
//                    job?.cancel()
//                    Dishedto.logDebug(TAG, "jumpNext")
//                    jumpNext()
//                    this.cancel()
//                }
//            }
//        }
//    }
//
//    var jumped: Boolean = false
//    private fun jumpNext() {
//        if (jumped) {
//            return
//        }
//        jumped = true
//        Dishedto.logDebug(TAG, "jumpNext actionId=$actionId")
//
//        when (actionId) {
//            ID_JUNK_CLEAN_PUSH -> {
//                startActivity(Intent(this, Celebrationedto::class.java))
//            }
//
//            ID_SIMILAR_IMAGE -> {
//                startActivity(Intent(this, Successedto::class.java))
//            }
//
//            ID_SCREENSHOT_CLEAN -> {
//                startActivity(Intent(this, Successedto::class.java))
//            }
//
//            ID_RECOVERY_PHOTOS -> {
//                startActivity(Intent(this, Archiveedto::class.java).apply {
//                    putExtra("ScanType", Dynamicedto.SCAN_PHOTOS)
//                })
//            }
//
//            ID_RECOVERY_VIDEOS -> {
//                startActivity(Intent(this, Archiveedto::class.java).apply {
//                    putExtra("ScanType", Dynamicedto.SCAN_VIDEOS)
//                })
//            }
//
//            ID_RECOVERY_DOCUMENTS -> {
//                startActivity(Intent(this, Archiveedto::class.java).apply {
//                    putExtra("ScanType", Dynamicedto.SCAN_DOCUMENTS)
//                })
//            }
//
//            ID_PRIVACY_SPACE -> {
//                if (privacyPinPassword.isNotEmpty()) {
//                    startActivity(Intent(this, Poemedto::class.java))
//                } else {
//                    startActivity(Intent(this, Reignedto::class.java).apply {
//
//                    })
//                }
//            }
//
//            ID_WHATSAPP_CLEANER -> {
//                startActivity(Intent(this, WhatsAppCleanerAnimationActivity::class.java))
//            }
//
//            ID_LARGE_FILE -> {
//                startActivity(Intent(this, Viableedto::class.java))
//            }
//
//            ID_APP_PROCESS -> {
//                startActivity(Intent(this, AppProcessAnimationActivity::class.java))
//            }
//
//            ID_APP_MANAGER -> {
//                startActivity(Intent(this, AppManagerAnimationActivity::class.java))
//            }
//
//            ID_BATTERY_INFO -> {
//                startActivity(Intent(this, Scrapedto::class.java))
//            }
//
//            else -> {
//                val isHotLaunch = intent?.extras?.getBoolean("isHotLaunch", false) ?: false
//                if (!isHotLaunch) {
//                    if (!isGuide) {
//                        startActivity(Intent(this@Reliefedto, Sailedto::class.java))
//                    } else {
//                        startActivity(Intent(this@Reliefedto, Moneyedto::class.java))
//                    }
//                }
//            }
//        }
//        finish()
//        intent.extras?.clear()
//    }
//
//    private fun closeNotification() {
//        sendBroadcast(Intent(this, Easilyedto::class.java).apply {
//            this.action = Easilyedto.Action
//            this.putExtra(NotificationId, actionId)
//        })
//    }
//
//    override fun initListener() {
//
//        binding.stuckedto.setOnClickListener {
//            if (oneClickStart) {
//                return@setOnClickListener
//            }
//            oneClickStart = true
//            ifAgreePrivacy = true
//            (application as Epicalyxedto).initApp(true)
//            Scandaledto.preloadAd(this)
//            binding.offeredto.visibility = View.GONE
//            binding.rainbowedto.visibility = View.VISIBLE
//            job = startProgress()
//        }
//    }
//
//    private var processTime = 0L
//    private var outTimeAdStart = false
//    private fun startProgress() = lifecycleScope.launch(Dispatchers.Main) {
//        Dishedto.logDebug(TAG, "startProgress")
//        while (isActive) {
//            val value = binding.sockedto.progress + 2
//            binding.sockedto.setProgress(value, true)
//            progress.emit(value)
//            val delayTime = 450L
//            delay(delayTime)
//            processTime += delayTime
//            if (processTime >= 900L) {
//                if (!outTimeAdStart) {
//                    outTimeAdStart = true
//                    outTimeAd()
//                }
//            }
//        }
//    }
//
//
//    private fun outTimeAd() {
//        Dishedto.logDebug(TAG, "outTimeAd")
//        var loaded: Boolean = true
//        Scandaledto.admobMaxShowOpenAd(this, showBeforeAction = { flag ->
//            loaded = flag
//            job?.cancel()
//        }) {
//            val sp = Stewardedto.getInstance().getString("splashShowInter", "0").toInt()
//            if (sp == 1 && !loaded) {
//                Scandaledto.admobMaxShowInterstitialAd(this, false) {
//                    binding.sockedto.progress = 100
//                    jumpNext()
//                }
//            } else {
//                binding.sockedto.progress = 100
//                jumpNext()
//            }
//        }
//    }
//
//    override fun onResume() {
//        super.onResume()
//        Dishedto.logDebug(TAG, "onResume")
//        if (ifAgreePrivacy && job?.isActive == false) {
//            job = startProgress()
//        }
//    }
//
//    override fun onPause() {
//        super.onPause()
//        job?.cancel()
//        Dishedto.logDebug(TAG, "onPause")
//    }
//
//
//}