Commit 4a1081ad authored by wanglei's avatar wanglei

....

parent 6ba8a8e5
...@@ -5,6 +5,7 @@ import android.os.Bundle ...@@ -5,6 +5,7 @@ import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.ViewGroup import android.view.ViewGroup
import android.view.ViewTreeObserver import android.view.ViewTreeObserver
import com.base.filerecoveryrecyclebin.BuildConfig
import com.base.filerecoveryrecyclebin.help.ConfigHelper import com.base.filerecoveryrecyclebin.help.ConfigHelper
import com.google.ads.mediation.admob.AdMobAdapter import com.google.ads.mediation.admob.AdMobAdapter
import com.google.android.gms.ads.AdListener import com.google.android.gms.ads.AdListener
...@@ -29,7 +30,7 @@ object AdmobBannerUtils { ...@@ -29,7 +30,7 @@ object AdmobBannerUtils {
val screenPixelDensity = context.resources.displayMetrics.density val screenPixelDensity = context.resources.displayMetrics.density
val adWidth = (parent.width / screenPixelDensity).toInt() val adWidth = (parent.width / screenPixelDensity).toInt()
val adSize = AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(context, adWidth) val adSize = AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(context, adWidth)
adView?.adUnitId = ConfigHelper.bannerAdmobId adView?.adUnitId = if (BuildConfig.DEBUG) ConfigHelper.bannerAdmobIdTest else ConfigHelper.bannerAdmobId
adView?.setAdSize(adSize) adView?.setAdSize(adSize)
loadCollapsibleBanner() loadCollapsibleBanner()
parent.viewTreeObserver.removeOnGlobalLayoutListener(listener) parent.viewTreeObserver.removeOnGlobalLayoutListener(listener)
......
...@@ -7,6 +7,8 @@ import com.applovin.sdk.AppLovinSdkInitializationConfiguration ...@@ -7,6 +7,8 @@ import com.applovin.sdk.AppLovinSdkInitializationConfiguration
import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper.isAdInit import com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper.isAdInit
import com.base.filerecoveryrecyclebin.utils.EventUtils import com.base.filerecoveryrecyclebin.utils.EventUtils
import com.base.filerecoveryrecyclebin.utils.LogEx import com.base.filerecoveryrecyclebin.utils.LogEx
import com.google.android.gms.ads.identifier.AdvertisingIdClient
import java.util.Collections
import java.util.concurrent.Executors import java.util.concurrent.Executors
object AdMaxInit { object AdMaxInit {
......
...@@ -17,7 +17,8 @@ object ConfigHelper { ...@@ -17,7 +17,8 @@ object ConfigHelper {
const val interAdmobId = "ca-app-pub-3940256099942544/1033173111" const val interAdmobId = "ca-app-pub-3940256099942544/1033173111"
const val nativeAdmobId = "ca-app-pub-3940256099942544/2247696111" const val nativeAdmobId = "ca-app-pub-3940256099942544/2247696111"
const val openAdmobId = "/6499/example/app-open" const val openAdmobId = "/6499/example/app-open"
const val bannerAdmobId = "ca-app-pub-3940256099942544/9214589111" const val bannerAdmobId = "ca-app-pub-3940256099942544/9214581111"
const val bannerAdmobIdTest = "ca-app-pub-3940256099942544/9214589741"
const val interAdMaxId = "b31e7f6d11ee659e" const val interAdMaxId = "b31e7f6d11ee659e"
const val nativeAdMaxId = "96e8fe78b0efc5d1" const val nativeAdMaxId = "96e8fe78b0efc5d1"
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
android:backgroundTint="@color/applovin_sdk_brand_color" android:backgroundTint="@color/applovin_sdk_brand_color"
android:textColor="@android:color/white" android:textColor="@android:color/white"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/media_view_container" app:layout_constraintTop_toBottomOf="@+id/ad_media"
tools:layout_editor_absoluteX="8dp" tools:layout_editor_absoluteX="8dp"
tools:text="Install" /> tools:text="Install" />
......
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