package importantedto.appliededto.surgeonedto.promiseedto.freedomedto

import android.annotation.SuppressLint
import android.graphics.Color
import android.os.Environment
import androidx.activity.addCallback
import com.base.datarecovery.R
import com.base.datarecovery.databinding.ConceptionedtoBinding
import importantedto.admireedto.sweptedto.Differenceedto
import importantedto.afteredto.constitutionaledto.Murderedto
import importantedto.concreteedto.cameedto.Hateedto.SCAN_AUDIOS
import importantedto.concreteedto.cameedto.Hateedto.SCAN_DOCUMENTS
import importantedto.concreteedto.cameedto.Hateedto.SCAN_PHOTOS
import importantedto.concreteedto.cameedto.Hateedto.SCAN_VIDEOS
import importantedto.gallonedto.Transcendedto
import java.io.File

class Fourthedto : Murderedto<ConceptionedtoBinding>() {

    override val binding: ConceptionedtoBinding by lazy {
        ConceptionedtoBinding.inflate(layoutInflater)
    }


    @SuppressLint("SetTextI18n")
    override fun initView() {

        Transcendedto.setStatusBarLightMode(this, true)
        Transcendedto.setStatusBarColor(this, Color.TRANSPARENT)

        val number = intent.extras?.getInt("Number") ?: 0
        val scanType = intent.extras?.getInt("ScanType")

        binding.steepedto.text = number.toString()
        val type = when (scanType) {
            SCAN_PHOTOS -> if (number == 1) "Photo" else "Photos"
            SCAN_VIDEOS -> if (number == 1) "Video" else "Videos"
            SCAN_DOCUMENTS -> if (number == 1) "Document" else "Documents"
            SCAN_AUDIOS -> if (number == 1) "Audio" else "Audios"
            else -> ""
        }
        binding.erroredto.text = type

        val appName = this.resources.getString(R.string.kettleedto)
        val appDir = File(Environment.getExternalStorageDirectory(), appName)
        binding.functionaledto.text = "Recovered in $appDir"
    }

    override fun initListener() {

        binding.bangedto.setOnClickListener {
            onBackPressedDispatcher.onBackPressed()
        }
        onBackPressedDispatcher.addCallback {
            Differenceedto.admobMaxShowInterstitialAd(this@Fourthedto,false) {
                finishToMain()
            }
        }
        binding.sideedto.setOnClickListener {
            Differenceedto.admobMaxShowInterstitialAd(this,false) {
                finish()
            }
        }
        binding.spentedto.setOnClickListener {
            onBackPressedDispatcher.onBackPressed()
        }
    }

}