|
@@ -6,6 +6,7 @@ import android.view.View
|
|
|
import android.widget.Button
|
|
|
import android.widget.ImageView
|
|
|
import android.widget.TextView
|
|
|
+import com.google.ads.mediation.facebook.FacebookAdapter
|
|
|
import com.google.android.gms.ads.AdListener
|
|
|
import com.google.android.gms.ads.AdLoader
|
|
|
import com.google.android.gms.ads.formats.MediaView
|
|
@@ -15,6 +16,7 @@ import com.google.android.gms.ads.formats.UnifiedNativeAdView
|
|
|
import com.kdanmobile.admanager.NativeAdListener
|
|
|
import com.kdanmobile.admanager.NativeAdManager
|
|
|
import com.kdanmobile.admanager.NativeAdViewBinder
|
|
|
+import com.kdanmobile.admanager.R
|
|
|
import java.util.concurrent.ConcurrentHashMap
|
|
|
import java.util.concurrent.CopyOnWriteArrayList
|
|
|
|
|
@@ -109,6 +111,14 @@ class AdmobNativeAdManager(private val context: Context) : NativeAdManager {
|
|
|
ad.callToAction?.apply { it.text = this }
|
|
|
callToActionView = it
|
|
|
}
|
|
|
+ findViewById<TextView>(nativeAdViewBinder.sponsoredTextView)?.let {
|
|
|
+ it.setText(when {
|
|
|
+ ad.extras.containsKey(FacebookAdapter.KEY_SOCIAL_CONTEXT_ASSET) -> {
|
|
|
+ R.string.advertisement_sponsored_text_fb
|
|
|
+ }
|
|
|
+ else -> R.string.advertisement_sponsored_text_admob
|
|
|
+ })
|
|
|
+ }
|
|
|
post {
|
|
|
setNativeAd(ad)
|
|
|
}
|