package com.base.datarecovery.activity.repeat

import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import androidx.activity.addCallback
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.base.datarecovery.R
import com.base.datarecovery.ads.AdmobInterstitialUtils
import com.base.datarecovery.databinding.ActivityRepeatAnimationBinding
import com.base.datarecovery.help.BaseActivity
import kotlin.random.Random

class RepeatAnimationActivity : BaseActivity<ActivityRepeatAnimationBinding>() {

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


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

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

}