Commit 8175cb30 authored by mengcuiguang2's avatar mengcuiguang2

代码优化

parent ace01f89
......@@ -70,19 +70,19 @@ object BannerManager {
if (it.size > 0) {
val ad: TTNativeExpressAd = it[0]
bannerAd = ad
if (bannerAd != null && bannerAd!!.mediationManager != null && bannerAd!!.mediationManager.showEcpm != null) {
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE3
vo["cpmFen"] = bannerAd!!.mediationManager.showEcpm.ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
bannerAd?.setExpressInteractionListener(object :
TTNativeExpressAd.ExpressAdInteractionListener {
override fun onAdClicked(view: View?, type: Int) {
}
override fun onAdShow(view: View?, type: Int) {
if (bannerAd != null && bannerAd!!.mediationManager != null && bannerAd!!.mediationManager.showEcpm != null
&& bannerAd!!.mediationManager.showEcpm.ecpm != null) {
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE3
vo["cpmFen"] = bannerAd!!.mediationManager.showEcpm.ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
}
override fun onRenderFail(view: View?, msg: String?, code: Int) {
......
......@@ -150,7 +150,7 @@ class DrawExpressManager {
private fun showAd(ttFeedAd: TTFeedAd?) {
ttFeedAd?.let {
if (it.mediationManager != null && it.mediationManager.showEcpm != null) {
if (it.mediationManager != null && it.mediationManager.showEcpm != null&& it.mediationManager.showEcpm.ecpm != null) {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE4
......
......@@ -143,7 +143,7 @@ class HomeDrawExpressManager {
private fun showAd(ttFeedAd: TTFeedAd?) {
ttFeedAd?.let {
if (it.mediationManager != null && it.mediationManager.showEcpm != null) {
if (it.mediationManager != null && it.mediationManager.showEcpm != null&& it.mediationManager.showEcpm.ecpm != null) {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE4
......
......@@ -119,13 +119,6 @@ class ExpressManager {
private fun showAd() {
mTTFeedAd?.let {
if (it.mediationManager != null && it.mediationManager.showEcpm != null) {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["cpmFen"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
if (it.mediationManager.isExpress) {
//--------------信息流模板广告渲染----------------
showExpressView(it)
......@@ -226,6 +219,14 @@ class ExpressManager {
override fun onAdShow() {
Log.i(TAG, "onAdShow")
Log.i(TAG, "ad mediaExtraInfo ${it.mediaExtraInfo}")
if (it.mediationManager != null && it.mediationManager.showEcpm != null && it.mediationManager.showEcpm.ecpm != null) {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["cpmFen"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
}
})
......
......@@ -13,6 +13,7 @@ import com.duben.speedplayletu.utils.ForegroundOrBackground
import com.duben.speedplayletu.utils.LogUtil
import com.duben.speedplayletu.utils.UIUtils
import com.duben.speedplayletu.BuildConfig
private val TAG = MainExpressManager::class.java.simpleName
/**
......@@ -79,13 +80,7 @@ class MainExpressManager {
expressAdCallback: ExpressAdCallback
) {
ttNativeAd?.let {
if (it.mediationManager != null && it.mediationManager.showEcpm != null) {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["cpmFen"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
if (it.mediationManager.isExpress) {
//--------------信息流模板广告渲染----------------
showExpressView(it, expressAdCallback)
......@@ -154,6 +149,13 @@ class MainExpressManager {
override fun onAdShow() {
Log.i(TAG, "onAdShow")
Log.i(TAG, "ad mediaExtraInfo ${it.mediaExtraInfo}")
if (it.mediationManager != null && it.mediationManager.showEcpm != null && it.mediationManager.showEcpm.ecpm != null) {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["cpmFen"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
}
})
......
......@@ -118,13 +118,6 @@ class MyExpressManager {
private fun showAd() {
mTTFeedAd?.let {
if (it.mediationManager != null && it.mediationManager.showEcpm != null) {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["cpmFen"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
if (it.mediationManager.isExpress) {
//--------------信息流模板广告渲染----------------
showExpressView(it)
......@@ -226,6 +219,13 @@ class MyExpressManager {
override fun onAdShow() {
Log.i(TAG, "onAdShow")
Log.i(TAG, "ad mediaExtraInfo ${it.mediaExtraInfo}")
if (it.mediationManager != null && it.mediationManager.showEcpm != null && it.mediationManager.showEcpm.ecpm != null) {
val ecpm = it.mediationManager.showEcpm.ecpm
val vo = HashMap<String, Any>()
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["cpmFen"] = ecpm
TrackManager.getInstance().cmtEcpm(vo)
}
}
})
......
......@@ -163,7 +163,7 @@ object SplashManager {
LogUtil.d(TAG, "gromore 开屏广告--> 6、onAdShow ")
mTTSplashAd?.let {
if (it.mediationManager != null && it.mediationManager.showEcpm != null) {
if (it.mediationManager != null && it.mediationManager.showEcpm != null&& it.mediationManager.showEcpm.ecpm != null) {
val vo = HashMap<String, Any>()
vo["cpmFen"] = it.mediationManager.showEcpm.ecpm
vo["adType"] = Constant.GRO_MORE_ADTYPE0
......
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