Commit bb2feb99 authored by mengcuiguang's avatar mengcuiguang

添加插屏事件

parent 194c8b14
......@@ -145,7 +145,11 @@ public class InterstitialGroManager {
}
}
public void showInteractionAd(Activity _activity) {
public void showInteractionAd(Activity _activity,WifiAdStatusListener wifiAdStatusListener) {
if (wifiAdStatusListener != null) {
this.wifiAdStatusListener = wifiAdStatusListener;
}
if (BuildConfig.DEBUG) {
LogUtil.d(TAG, "showInteractionAd isLoadSuccess=" + isLoadSuccess + " isReady=" + mInterstitialAd.isReady());
}
......
......@@ -46,7 +46,7 @@ class WifiAdManager private constructor() {
when (currentAdType) {
Constant.GROMORE_INSERTSCREEN_AD -> {
preLoadInterstitialGroMore(activity,true)
preLoadInterstitialGroMore(activity, true)
}
Constant.GROMORE_FULL_AD -> {
preLoadFullGroMore(activity, true)
......@@ -99,6 +99,7 @@ class WifiAdManager private constructor() {
interstitialGroManager?.onDestroy()
}
interstitialGroManager = InterstitialGroManager()
interstitialGroManager?.setWifiAdStatusListener(wifiAdStatusListener)
interstitialGroManager?.loadInsertScreenAd(activity, isMain)
}
......@@ -120,20 +121,7 @@ class WifiAdManager private constructor() {
fun showInterstitial(_activity: Activity) {
when (currentAdType) {
Constant.GROMORE_INSERTSCREEN_AD -> {
interstitialGroManager?.setWifiAdStatusListener(object : WifiAdStatusListener {
override fun adSuccess() {
wifiAdStatusListener?.adSuccess()
}
override fun adFail() {
wifiAdStatusListener?.adFail()
}
override fun adClose() {
wifiAdStatusListener?.adClose()
}
})
interstitialGroManager?.showInteractionAd(_activity)
interstitialGroManager?.showInteractionAd(_activity, wifiAdStatusListener)
}
Constant.GROMORE_FULL_AD -> {
fullGroManager?.showFullAd(_activity, wifiAdStatusListener)
......
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