package com.test.basd.supercleanermax.notificationclean

import android.content.Intent
import android.graphics.Color
import androidx.core.view.updatePadding
import com.blankj.utilcode.util.BarUtils
import com.blankj.utilcode.util.SPUtils
import com.test.basd.supercleanermax.databinding.ActivityLayoutTionGuestBinding
import com.test.basd.supercleanermax.helps.BaseActivity
import com.test.basd.supercleanermax.helps.ads.AdmobUtils
import kotlin.random.Random

class NotificationGuestActivity : BaseActivity<ActivityLayoutTionGuestBinding>() {


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


    override fun initView() {
        BarUtils.setStatusBarLightMode(this, true)
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
        binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
        binding.idTzGuest.imageAssetsFolder = "ying_smax_dao/images/"
        binding.idTzGuest.setAnimation("ying_smax_dao/data.json")
        binding.idTzGuest.playAnimation()
        SPUtils.getInstance().put("notification_guest", true)
        binding.root.postDelayed({
            AdmobUtils.showInterstitialAd(this) {
                startActivity(Intent(this, NotificationCleanActivity::class.java))
                finish()
            }
        }, Random.nextLong(2500, 4000))
        binding.idTvTryNow.setOnClickListener {
            startActivity(Intent(this, NotificationCleanActivity::class.java))
            finish()
        }
        binding.idTGuanbi.setOnClickListener {
            finishToMain()
        }
    }

}