package com.base.filerecoveryrecyclebin.activity.guide

import android.content.Intent
import androidx.activity.addCallback
import com.base.filerecoveryrecyclebin.R
import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import com.base.filerecoveryrecyclebin.databinding.ActivityWhichWantGuideBinding
import com.base.filerecoveryrecyclebin.help.BaseActivity

class WhichWantGuideActivity : BaseActivity<ActivityWhichWantGuideBinding>() {

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


    override fun initView() {
        changeNative()
        binding.llPhoto.setOnClickListener {
            binding.iv1.isSelected = !binding.iv1.isSelected
            changeNative()
        }
        binding.llVideo.setOnClickListener {
            binding.iv2.isSelected = !binding.iv2.isSelected
            changeNative()
        }

        binding.llAudio.setOnClickListener {
            binding.iv3.isSelected = !binding.iv3.isSelected
            changeNative()
        }

        binding.llDocument.setOnClickListener {
            binding.iv4.isSelected = !binding.iv4.isSelected
            changeNative()
        }

        onBackPressedDispatcher.addCallback {
            finishToMain()
        }

        binding.llContinue.setOnClickListener {
            startActivity(Intent(this@WhichWantGuideActivity, GuideActivity::class.java))
            finish()
        }
    }

    private fun changeNative() {
        AdmobMaxHelper.admobMaxShowNativeAd(this, binding.flAd, R.layout.layout_native_custom)
    }

}