Commit 65b833d7 authored by wanglei's avatar wanglei

Merge remote-tracking branch 'origin/master'

parents abfaf2a9 b76d7bcf
......@@ -14,6 +14,7 @@ import com.base.filerecoveryrecyclebin.ads.max.AdMaxNativeUtils
import com.base.filerecoveryrecyclebin.ads.max.AdMaxOpenUtils
import com.base.filerecoveryrecyclebin.help.BaseApplication
import com.base.filerecoveryrecyclebin.utils.AppPreferences
import com.base.filerecoveryrecyclebin.utils.EventUtils
import com.base.filerecoveryrecyclebin.utils.LogEx
import com.google.android.gms.ads.MobileAds
import java.util.concurrent.atomic.AtomicBoolean
......@@ -78,17 +79,20 @@ object AdmobMaxHelper {
var lastShowedOnHiddenTime = 0L
fun admobMaxShowInterstitialAd(activity: Activity, isLoading: Boolean = true, onHidden: (() -> Unit)? = null) {
if (isBlack) {
EventUtils.event("ad_black","interAd")
onHidden?.invoke()
return
}
val isShowLoadingAd = AppPreferences.getInstance().getString("isShowLoadingAd", "0").toInt()
if (isShowLoadingAd == 0 && isLoading) {
EventUtils.event("ad_switch_close")
onHidden?.invoke()
return
}
val adInterval = AppPreferences.getInstance().getString("adInterval", "0").toInt()
if ((System.currentTimeMillis() - lastShowedOnHiddenTime) < adInterval * 1000 && lastShowedOnHiddenTime != 0L) {
onHidden?.invoke()
EventUtils.event("ad_interval")
return
}
......@@ -108,6 +112,7 @@ object AdmobMaxHelper {
onHidden: (() -> Unit)? = null,
) {
if (isBlack) {
EventUtils.event("ad_black","openAd")
onHidden?.invoke()
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment