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

[修改]广告总开关

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