Commit b1bf6c19 authored by wanglei's avatar wanglei Committed by songjianyu

[修改]广告总开关

parent 23c4eab7
......@@ -72,6 +72,15 @@ object AdsMgr {
var isMaxInit = false
private set
var isAdUtEvent = false
fun eventAdUt() {
if (!isAdUtEvent) {
isAdUtEvent = true
EventUtils.event("ad_ut_${configBean.ut}")
}
}
/**
* Init 初始化
*
......@@ -157,6 +166,13 @@ object AdsMgr {
isUnLimit: Boolean = false,
showCallBack: AdsShowCallBack? = null,
) {
eventAdUt()
if (!adsConfigBean.isAdShow) {
showCallBack?.failed()
return
}
if (configBean.isInBlackList) {
EventUtils.event("isInBlackList", "isInBlackList=${configBean.isInBlackList}")
showCallBack?.failed()
......@@ -196,6 +212,13 @@ object AdsMgr {
isUnLimit: Boolean = false,
showCallBack: AdsShowCallBack? = null,
) {
eventAdUt()
if (!adsConfigBean.isAdShow) {
showCallBack?.failed()
return
}
if (configBean.isInBlackList) {
EventUtils.event("isInBlackList", configBean.isInBlackList.toString())
showCallBack?.failed()
......@@ -221,6 +244,10 @@ object AdsMgr {
@LayoutRes layout: Int,
nativeCallBack: ((Any?) -> Unit)? = null
) {
if (!adsConfigBean.isAdShow) {
nativeCallBack?.invoke(null)
return
}
if (configBean.isInBlackList) {
EventUtils.event("isInBlackList", configBean.isInBlackList.toString())
return
......@@ -248,6 +275,9 @@ object AdsMgr {
* @param parent 展示广告的父布局容器
*/
fun showBanner(parent: ViewGroup, collapsible: Boolean = true, adClose: (() -> Unit)? = null) {
if (!adsConfigBean.isAdShow) {
return
}
if (configBean.isInBlackList) {
EventUtils.event("isInBlackList", configBean.isInBlackList.toString())
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