Commit abfaf2a9 authored by wanglei's avatar wanglei

...

parent 49d4e644
......@@ -34,7 +34,13 @@ object AdmobBannerUtils {
}
adView = AdView(context)
adView?.tag = "CollapsibleBannerAd"
parent.removeAllViews()
// parent.removeAllViews()
val list = parent.children
list.forEach {
if (it.tag != "zhanweitu") {
parent.removeView(it)
}
}
parent.addView(adView)
listener = ViewTreeObserver.OnGlobalLayoutListener {
val screenPixelDensity = context.resources.displayMetrics.density
......
......@@ -120,11 +120,19 @@
</LinearLayout>
<FrameLayout
android:visibility="gone"
android:id="@+id/fl_banner"
android:layout_width="match_parent"
android:layout_height="60dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll" />
app:layout_constraintTop_toBottomOf="@id/ll">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/zhanweitu"
android:tag="zhanweitu"
tools:ignore="ContentDescription" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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