Commit f5ac4279 authored by maxiaoliang's avatar maxiaoliang

修改id

parent d44b5e48
...@@ -90,7 +90,7 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> { ...@@ -90,7 +90,7 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
} }
override fun onAdError(errorMsg: String?) { override fun onAdError(errorMsg: String?) {
Log.e("MXL","onAdError"+errorMsg) Log.e("MXL", "onAdError" + errorMsg)
} }
override fun onAdClose() { override fun onAdClose() {
...@@ -130,7 +130,7 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> { ...@@ -130,7 +130,7 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
if (isInitial && isVisible) { if (isInitial && isVisible) {
UserDataUtils.updateUserInfo(this) UserDataUtils.updateUserInfo(this)
getAds() getAds()
// showIntriAd() // showIntriAd()
} }
} }
...@@ -202,17 +202,12 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> { ...@@ -202,17 +202,12 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
private fun getAds() { private fun getAds() {
var slotId = "bigimage" var slotId = "bigimage"
Log.d("MXL","getAds ")
ApiClient.adApi.getAds(slotId) ApiClient.adApi.getAds(slotId)
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<NewsEntity>>() { .subscribe(object : BaseObserver<List<NewsEntity>>() {
override fun onSuccess(result: List<NewsEntity>) { override fun onSuccess(result: List<NewsEntity>) {
if (result != null && result?.isNotEmpty()) { if (result != null && result?.isNotEmpty()) {
if (result?.isNotEmpty()) { updataAdView(slotId, result?.get(0), 0)
updataAdView(slotId, result?.get(0), 0)
} else {
updataAdView(slotId, null, 0)
}
} else { } else {
updataAdView(slotId, null, 0) updataAdView(slotId, null, 0)
......
...@@ -34,8 +34,8 @@ object CSJAdManager { ...@@ -34,8 +34,8 @@ object CSJAdManager {
} }
fun adInit(context: Context, appId: String, initCallback: TTAdSdk.InitCallback?) { fun adInit(context: Context, appId: String, initCallback: TTAdSdk.InitCallback?) {
TTAdManagerHolder.init(context, appId, initCallback) TTAdManagerHolder.init(context, appId, initCallback)
// TTAdManagerHolder.init(context, "5335826", initCallback) //TTAdManagerHolder.init(context, "5335826", initCallback)
} }
private var splashAd: TTSplashAd? = null private var splashAd: TTSplashAd? = null
...@@ -159,7 +159,8 @@ object CSJAdManager { ...@@ -159,7 +159,8 @@ object CSJAdManager {
//step4:创建广告请求参数AdSlot,具体参数含义参考文档 //step4:创建广告请求参数AdSlot,具体参数含义参考文档
val adSlot = AdSlot.Builder() val adSlot = AdSlot.Builder()
.setCodeId(entity.codeId) //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD .setCodeId(entity.codeId) //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD
// .setCodeId("949814576") //此次加载广告的用途是实时加载,当用来作为缓存时,请使用:TTAdLoadType.PRELOAD
.setAdLoadType(TTAdLoadType.LOAD) .setAdLoadType(TTAdLoadType.LOAD)
.build() .build()
mTTAdNative?.loadFullScreenVideoAd(adSlot, object : TTAdNative.FullScreenVideoAdListener { mTTAdNative?.loadFullScreenVideoAd(adSlot, object : TTAdNative.FullScreenVideoAdListener {
...@@ -194,7 +195,7 @@ object CSJAdManager { ...@@ -194,7 +195,7 @@ object CSJAdManager {
//该方法直接展示广告 //该方法直接展示广告
//mttFullVideoAd.showFullScreenVideoAd(FullScreenVideoActivity.this); //mttFullVideoAd.showFullScreenVideoAd(FullScreenVideoActivity.this);
innterstitialAd?.showFullScreenVideoAd(context) innterstitialAd?.showFullScreenVideoAd(context,TTAdConstant.RitScenes.GAME_GIFT_BONUS, null)
innterstitialAd = null innterstitialAd = null
innterstitialAd?.setFullScreenVideoAdInteractionListener(object : innterstitialAd?.setFullScreenVideoAdInteractionListener(object :
TTFullScreenVideoAd.FullScreenVideoAdInteractionListener { TTFullScreenVideoAd.FullScreenVideoAdInteractionListener {
......
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