Commit bfa952e7 authored by wanglei's avatar wanglei

...

parent bcffa262
......@@ -257,7 +257,7 @@ class MyApplication : Application() {
//广告
AdConfigBean.adsConfigBean = configBean.adConfigBean
LogEx.logDebug("initConfig", "adsConfigBean=${AdConfigBean.adsConfigBean.functionInShowAd}")
LogEx.logDebug("initConfig", "adsConfigBean=${AdConfigBean.adsConfigBean.timeInterval}")
//通知
PopupConfigBean.popupConfigBean = configBean.popupConfigBean
......
......@@ -31,6 +31,18 @@ class AdInsertMgr {
showCallBack?.failed(0)
return
}
if (!isUnLimit) {
if (!LimitUtils.isAdShow(AdsType.INSERT, adEvent)) {
showCallBack?.failed(2)
return
}
if (LimitUtils.isIntervalLimited(adState.lastShowTime, adEvent)) {
showCallBack?.failed(3)
return
}
}
if (adState.showingAd) {
showCallBack?.failed(1)
adEvent.adShowError("showingAd")
......@@ -49,17 +61,6 @@ class AdInsertMgr {
if (!adState.loadingAd) {
if (!isUnLimit) {
if (!LimitUtils.isAdShow(AdsType.INSERT, adEvent)) {
showCallBack?.failed(2)
return
}
if (LimitUtils.isIntervalLimited(adState.lastShowTime, adEvent)) {
showCallBack?.failed(3)
return
}
}
if (adState.currentAd == null) {
loadAd(activity, isUnLimit, adEvent)
return
......
......@@ -30,6 +30,16 @@ class AdOpenMgr {
if (activity.isFinishing || activity.isDestroyed) {
return
}
if (!isUnLimit) {
if (!LimitUtils.isAdShow(AdsType.OPEN, adEvent)) {
showCallBack?.failed()
return
}
if (LimitUtils.isIntervalLimited(adState.lastShowTime, adEvent)) {
showCallBack?.failed()
return
}
}
if (adState.showingAd) {
showCallBack?.failed()
adEvent.adShowError("showingAd")
......@@ -43,16 +53,7 @@ class AdOpenMgr {
}
if (!adState.loadingAd) {
if (!isUnLimit) {
if (!LimitUtils.isAdShow(AdsType.OPEN, adEvent)) {
showCallBack?.failed()
return
}
if (LimitUtils.isIntervalLimited(adState.lastShowTime, adEvent)) {
showCallBack?.failed()
return
}
}
if (!adAvailable() || adState.currentAd == null) {
loadAd(activity, isUnLimit, adEvent)
return
......
......@@ -3,7 +3,7 @@ package com.base.scanqr.bean.config
class PopupConfigBean(
var popupStatus: Boolean = true,
var popupCount: Int = 24,
var popupCount: Int = 100,
var popupStart: Int = 0,
var popupEnd: Int = 24,
var popupInterval: Int = 1,
......
......@@ -10,6 +10,7 @@ import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import com.base.scanqr.R
import com.base.scanqr.ads.AdsMgr
import com.base.scanqr.ads.AdsShowCallBack
import com.base.scanqr.base.BaseActivity
import com.base.scanqr.bean.ConstObject.mainStartTimes
import com.base.scanqr.bean.HomeTabUIBean
......@@ -146,6 +147,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
0 -> {
tabAt = 0
navController?.navigate(R.id.createFragment)
AdsMgr.showInsert(this,false,object :AdsShowCallBack(){
override fun close(where: Int) {
}
override fun failed(where: Int) {
}
override fun googleFailed(where: Int) {
}
})
}
1 -> {
......
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