package com.base.datarecovery.activity.screenshot

import android.content.Intent
import android.widget.Toast
import androidx.activity.addCallback
import com.base.datarecovery.activity.repeat.RepeatActivity
import com.base.datarecovery.ads.AdmobInterstitialUtils
import com.base.datarecovery.databinding.ActivityScreenShotAnimationBinding
import com.base.datarecovery.help.BaseActivity
import kotlin.random.Random

class ScreenShotAnimationActivity : BaseActivity<ActivityScreenShotAnimationBinding>() {

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

    override fun initView() {
        binding.root.postDelayed({
            AdmobInterstitialUtils.showInterstitialAd(this) {
                startActivity(Intent(this, ScreenShotActivity::class.java))
                finish()
            }
        }, Random.nextLong(3000, 4500))
    }

    override fun initListener() {
        super.initListener()
        onBackPressedDispatcher.addCallback {
            Toast.makeText(this@ScreenShotAnimationActivity, "wait a moment", Toast.LENGTH_SHORT).show()
        }
    }

}