package com.base.filerecoveryrecyclebin.ads

import com.base.filerecoveryrecyclebin.utils.ActivityManagerUtils

object AdmobCommonUtils {

    private var lastAd: Any? = null
    private var maxMultiClick = 4
    private var multiClick = 0
    fun isMultiClick(currentAd: Any?) {
        if (currentAd == null) {
            return
        }
        if (lastAd == currentAd) {
            multiClick++
            if (multiClick >= maxMultiClick) {
                AdDisplayUtils.getInstance()
                    .setAdClickCount(AdDisplayUtils.getInstance().maxAdClickCount)
                ActivityManagerUtils.getInstance().finishAllActivity()
                return
            }
        } else {
            multiClick = 0
        }

        lastAd = currentAd

    }
}