package foamyic

import android.annotation.SuppressLint
import android.content.Intent
import com.easy.clean.R
import tooic.fatalityic.jittersic.Peteric
import autonomyic.polemicalic.congestionic.Unwindic
import com.easy.clean.databinding.OuchicBinding
import waific.Teflonic.therapistic.Hauntingic

class Backpackic : Peteric<OuchicBinding>(OuchicBinding::inflate) {
    var page: Int = 1


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

        when (page) {
            0 -> {
                binding.ladleic.setImageResource(R.drawable.wantedic)
                binding.shouldic.setImageResource(R.drawable.jaileric)
                binding.spadesic.text = getString(R.string.strutic)
            }

            1 -> {
                binding.ladleic.setImageResource(R.drawable.lusteric)
                binding.shouldic.setImageResource(R.drawable.guiltyic)
                binding.spadesic.text = getString(R.string.pollenic)
            }

            3 -> {
                binding.ladleic.setImageResource(R.drawable.conceiveic)
                binding.shouldic.setImageResource(R.drawable.sceneic)
                binding.spadesic.text = getString(R.string.overridingic)
                binding.dressic.text = "Start"
            }
        }

    }

    override fun initListener() {
        super.initListener()
        binding.seafoodic.setOnClickListener {
            val activity = requireActivity() as Onlyic?
            activity?.startActivity(Intent(activity, Hauntingic::class.java))
            activity?.finish()
        }
        binding.dressic.setOnClickListener {
            val activity = requireActivity() as Onlyic?
            activity ?: requireActivity()
            activity?.next(page)
        }
    }


    override fun onResume() {
        super.onResume()

        if (!binding.protectic.isAdShowed) {
            Unwindic.showNative(binding.protectic, R.layout.explanatoryic)
        }
    }
}