|
@@ -140,13 +140,6 @@ class NativeAdView : LinearLayout {
|
|
|
//把广告商的View先加进来
|
|
|
super.addView(child, index, params)
|
|
|
Log.e("测试", "if else, child:${child?.javaClass?.simpleName}")
|
|
|
-
|
|
|
-// if (advertisersContainerView != this) {
|
|
|
-// 如果广告商的view 不是当前view, 让广告商view 添加child
|
|
|
-// advertisersContainerView?.addView(child, index, params)
|
|
|
-// } else {
|
|
|
-// super.addView(child, index, params)
|
|
|
-// }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -180,7 +173,7 @@ class NativeAdView : LinearLayout {
|
|
|
override fun onAdDisLike() {
|
|
|
super.onAdDisLike()
|
|
|
isVisible = false
|
|
|
- removeAllViews()
|
|
|
+ advertisersContainerView?.removeAllViews()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -195,7 +188,6 @@ class NativeAdView : LinearLayout {
|
|
|
val root = getChildAt(0) as ViewGroup
|
|
|
advertisersContainerView = root
|
|
|
Log.e("测试", "厂商布局解析完成: root${root.javaClass.simpleName}")
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -209,7 +201,6 @@ class NativeAdView : LinearLayout {
|
|
|
AdLoad.populateNativeAdView(context, adResult as AdResult.Success, viewHolder!!, advertisersContainerView!!)
|
|
|
isVisible = true
|
|
|
}
|
|
|
-
|
|
|
if (advertisersContainerView == null){
|
|
|
adLogE(tag = "原生广告NativeAdView", msg = "厂商的原生广告容器为null, 请指定 ad_admob_native_ad_view_layout 或 其他属性")
|
|
|
}
|