package rallyedto.finishedto.biggestedto.canedto.greenedto

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.MultiplyedtoBinding
import rallyedto.battleedto.acresedto.Lemonedto
import rallyedto.policeedto.huntedto.Snuggleedto.SCAN_AUDIOS
import rallyedto.policeedto.huntedto.Snuggleedto.SCAN_DOCUMENTS
import rallyedto.policeedto.huntedto.Snuggleedto.SCAN_PHOTOS
import rallyedto.policeedto.huntedto.Snuggleedto.SCAN_VIDEOS
import rallyedto.sunedto.tumouredto.majorityedto.loseedto.Togetheredto
import rallyedto.talledto.blewedto.Islandedto
import java.io.File

class Stitchedto : Lemonedto<MultiplyedtoBinding>() {

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


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

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

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

        binding.grabbededto.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.noedto.text = type

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

    override fun initListener() {

        binding.unfortunateedto.setOnClickListener {
            onBackPressedDispatcher.onBackPressed()
        }
        onBackPressedDispatcher.addCallback {
            admobMaxShowInterstitialAd(isShow = Togetheredto.isShowAdBackInter()) {
                finishToMain()
            }
        }
        binding.recklessedto.setOnClickListener {
            admobMaxShowInterstitialAd(true) {
                finish()
            }
        }
        binding.possessionedto.setOnClickListener {
            onBackPressedDispatcher.onBackPressed()
        }
    }

}