package com.base.superfilemanager.activity.speed

import android.animation.Animator
import android.content.Intent
import android.graphics.Color
import androidx.core.view.updatePadding
import com.blankj.utilcode.util.BarUtils
import com.base.superfilemanager.activity.ResultActivity
import com.base.superfilemanager.databinding.ActivityLayoutSpeedFinishBinding
import com.base.superfilemanager.helps.BaseActivity
import com.base.superfilemanager.helps.ads.AdmobUtils

class SpeedFinishActivity : BaseActivity<ActivityLayoutSpeedFinishBinding>() {


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

    override fun initView() {
        BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
        val type=intent.getStringExtra("type")
        binding.root.updatePadding(top = BarUtils.getStatusBarHeight())

        binding.idSpeedFinish.addAnimatorListener(object : Animator.AnimatorListener {
            override fun onAnimationStart(p0: Animator) {

            }

            override fun onAnimationEnd(p0: Animator) {
                AdmobUtils.showInterstitialAd(this@SpeedFinishActivity) {
                    startActivity(
                        Intent(
                            this@SpeedFinishActivity,
                            ResultActivity::class.java
                        ).putExtra("from", type)
                    )
                    finish()
                }

            }

            override fun onAnimationCancel(p0: Animator) {

            }

            override fun onAnimationRepeat(p0: Animator) {

            }

        })
    }

}