package com.easy.clean.ui.guide

import androidx.activity.addCallback
import com.easy.clean.R
import com.easy.clean.base.BaseActivity
import com.easy.clean.business.ads.AdsMgr
import com.easy.clean.databinding.ActivityGuideCleanBinding

class GuideCleanActivity : BaseActivity<ActivityGuideCleanBinding>(ActivityGuideCleanBinding::inflate) {

    override fun initView() {
        super.initView()

    }

    override fun initListener() {
        super.initListener()
        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 {
            goToAc(GuideActivity::class.java)
            finish()
        }
    }

    private fun changeNative() {
        AdsMgr.showNative(binding.flAd, R.layout.layout_admob_native_custom)
    }
}