package com.test.basd.smartjunkcleaner.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.smartjunkcleaner.databinding.ActivityLayoutTionGuestBinding
import com.test.basd.smartjunkcleaner.helps.BaseActivity
import com.test.basd.smartjunkcleaner.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_sjunk_dao/images/"
        binding.idTzGuest.setAnimation("ying_sjunk_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 {
            AdmobUtils.showInterstitialAd(this@NotificationGuestActivity) {
                finishToMain()
            }
        }
    }

}