Commit 42a8efa0 authored by wanglei's avatar wanglei

...

parent 6dd20caa
...@@ -126,7 +126,6 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() { ...@@ -126,7 +126,6 @@ class ResultActivity : BaseActivity<ActivityLayoutResultBinding>() {
binding.ivBack.setOnClickListener { binding.ivBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed() onBackPressedDispatcher.onBackPressed()
} }
AdmobNativeUtils.showNativeAd(this@ResultActivity, binding.flAd, R.layout.layout_native_custom_white) AdmobNativeUtils.showNativeAd(this@ResultActivity, binding.flAd, R.layout.layout_native_custom_white)
} }
......
...@@ -12,11 +12,6 @@ import com.base.datarecovery.help.ConfigHelper ...@@ -12,11 +12,6 @@ import com.base.datarecovery.help.ConfigHelper
import com.base.datarecovery.utils.EventUtils import com.base.datarecovery.utils.EventUtils
import com.base.datarecovery.utils.LogEx import com.base.datarecovery.utils.LogEx
import com.base.datarecovery.view.CustomDialog import com.base.datarecovery.view.CustomDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.async
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.json.JSONObject import org.json.JSONObject
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import kotlin.math.min import kotlin.math.min
...@@ -37,8 +32,6 @@ object AdMaxInterstitialUtils { ...@@ -37,8 +32,6 @@ object AdMaxInterstitialUtils {
private fun setListener(activity: Activity) { private fun setListener(activity: Activity) {
if (interstitialAd == null) { if (interstitialAd == null) {
interstitialAd = MaxInterstitialAd(ConfigHelper.interAdMaxId, activity) interstitialAd = MaxInterstitialAd(ConfigHelper.interAdMaxId, activity)
}
interstitialAd?.setListener(object : MaxAdListener { interstitialAd?.setListener(object : MaxAdListener {
override fun onAdLoaded(p0: MaxAd) { override fun onAdLoaded(p0: MaxAd) {
LogEx.logDebug(TAG, "onAdLoaded") LogEx.logDebug(TAG, "onAdLoaded")
...@@ -57,7 +50,7 @@ object AdMaxInterstitialUtils { ...@@ -57,7 +50,7 @@ object AdMaxInterstitialUtils {
onHidden?.invoke() onHidden?.invoke()
customDialog?.dismiss() customDialog?.dismiss()
retryAttempt = 0 retryAttempt = 0
}else{ } else {
interstitialAd?.loadAd() interstitialAd?.loadAd()
// MainScope().async { // MainScope().async {
// interstitialAd?.loadAd() // interstitialAd?.loadAd()
...@@ -88,6 +81,7 @@ object AdMaxInterstitialUtils { ...@@ -88,6 +81,7 @@ object AdMaxInterstitialUtils {
} }
}) })
} }
}
fun showInterstitialAd( fun showInterstitialAd(
activity: Activity, activity: Activity,
...@@ -133,40 +127,6 @@ object AdMaxInterstitialUtils { ...@@ -133,40 +127,6 @@ object AdMaxInterstitialUtils {
return System.currentTimeMillis() - interLoadTime > 1000 * 60 * 60 return System.currentTimeMillis() - interLoadTime > 1000 * 60 * 60
} }
private fun showIntervalDialogAndShowAd(
activity: Activity,
isShowDialog: Boolean,
onHidden: (() -> Unit)?,
interval: Int
) {
// if (!isShowDialog) {
// return
// }
//
// if (customDialog != null && customDialog?.isShowing == true) {
// return // 如果对话框已经显示,则不再显示
// }
//
// customDialog = CustomDialog(activity, R.layout.dialog_ad_loading)
// customDialog?.setCountdownText(R.id.dialog_ad_loading_text)
// val countdownTimer = object : CountDownTimer((interval * 1000).toLong(), 1000) {
// override fun onTick(millisUntilFinished: Long) {
// val seconds = (millisUntilFinished / 1000).toInt()
// customDialog?.updateCountdownText("Advertising in preparation ($seconds" + "s)...")
// }
//
// override fun onFinish() {
// if (!activity.isDestroyed && !activity.isFinishing) {
// customDialog?.dismiss()
// }
// customDialog = null
// LogEx.logDebug(TAG, "onFinish")
// interstitialAd?.showAd()
// }
// }
// countdownTimer.start()
// customDialog?.show()
}
private fun showAdDialogAndLoadInterstitial( private fun showAdDialogAndLoadInterstitial(
activity: Activity, activity: Activity,
......
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