Commit ffddbee7 authored by wanglei's avatar wanglei

[商业化]优化上报的卡顿问题

parent 9d0c1a11
......@@ -3,6 +3,9 @@ package com.base.appzxhy.business.ads
import com.base.appzxhy.MyApplication
import com.base.appzxhy.business.helper.EventUtils
import com.base.appzxhy.utils.LogEx
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import org.json.JSONObject
import java.util.UUID
......@@ -18,6 +21,7 @@ val taichiSharedPreferencesEditor by lazy {
abstract class AdEvent {
abstract val TAG: String
var adUnit: String = ""
......
......@@ -42,7 +42,7 @@ class AdBannerMgr {
adView = AdView(parent.context)
parent.addView(adView)
adView?.onPaidEventListener = AdmobEvent.EventOnPaidEventListener(adView)
adView?.onPaidEventListener = AdmobOnPaidEventListener(adView, admobEvent.scope)
listener = ViewTreeObserver.OnGlobalLayoutListener {
val screenPixelDensity = parent.context.resources.displayMetrics.density
......
......@@ -150,7 +150,7 @@ class AdInterMgr {
}
(adEvent as AdmobEvent).pullAd(ad.responseInfo)
LimitUtils.addRequestNum()
ad.onPaidEventListener = AdmobEvent.EventOnPaidEventListener(ad)
ad.onPaidEventListener = AdmobOnPaidEventListener(adEvent.scope)
}
override fun onAdFailedToLoad(loadAdError: LoadAdError) {
......
......@@ -52,7 +52,7 @@ class AdNativeMgr {
).forNativeAd { nativeAd ->
lastTime = System.currentTimeMillis()
nativeAd.setOnPaidEventListener(AdmobEvent.EventOnPaidEventListener(nativeAd))
nativeAd.setOnPaidEventListener(AdmobOnPaidEventListener(nativeAd, admobEvent.scope))
currentNativeAd = nativeAd
admobEvent.pullAd(nativeAd.responseInfo)
......
......@@ -141,7 +141,7 @@ class AdOpenMgr {
showReadyAd(adEvent)
}
(adEvent as AdmobEvent).pullAd(appOpenAd.responseInfo)
appOpenAd.onPaidEventListener = AdmobEvent.EventOnPaidEventListener(appOpenAd)
appOpenAd.onPaidEventListener = AdmobOnPaidEventListener(appOpenAd, adEvent.scope)
LimitUtils.addRequestNum()
}
......
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