package com.dumpster.cleaner.ui.guide

import androidx.activity.addCallback
import com.dumpster.cleaner.R
import com.dumpster.cleaner.base.BaseActivity
import com.dumpster.cleaner.business.ads.AdsMgr
import com.dumpster.cleaner.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)
    }
}