Commit f984370d authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 8ae52ca2
......@@ -9,6 +9,7 @@ import com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot
import com.bytedance.sdk.openadsdk.mediation.ad.MediationNativeToBannerListener
import com.duben.miniplaylet.BuildConfig
import com.duben.miniplaylet.MintsApplication
import com.duben.miniplaylet.ad.splash.SplashManager
import com.duben.miniplaylet.common.Constant
import com.duben.miniplaylet.manager.TrackManager
import com.duben.miniplaylet.utils.LogUtil
......@@ -71,7 +72,10 @@ object BannerManager {
}
override fun onAdShow(view: View?, type: Int) {
if (bannerAd != null && bannerAd!!.mediationManager.showEcpm != null) {
try {
if (bannerAd != null && bannerAd!!.mediationManager != null
&& bannerAd!!.mediationManager.showEcpm != null
) {
val vo = HashMap<String, Any>()
vo["adcode"] =
bannerAd!!.mediationManager.showEcpm.slotId
......@@ -83,6 +87,11 @@ object BannerManager {
vo["adType"] = Constant.GRO_MORE_ADTYPE5
TrackManager.getInstance().reporGromeEcpm(vo)
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun onRenderFail(view: View?, msg: String?, code: Int) {
......
......@@ -218,7 +218,7 @@ class ExpressManager {
}
override fun onAdShow() {
if (it != null && it!!.getMediationManager().getShowEcpm() != null) {
if (it != null && it!!.getMediationManager()!=null && it!!.getMediationManager().getShowEcpm() != null) {
val vo = HashMap<String, Any>()
vo["adcode"] = it!!.getMediationManager().getShowEcpm().getSlotId()
vo["ecpm"] = it!!.getMediationManager().getShowEcpm().getEcpm()
......
......@@ -153,7 +153,7 @@ class MainExpressManager {
}
override fun onAdShow() {
if (it != null && it!!.getMediationManager().getShowEcpm() != null) {
if (it != null && it!!.getMediationManager()!=null&& it!!.getMediationManager().getShowEcpm() != null) {
val vo = HashMap<String, Any>()
vo["adcode"] = it!!.getMediationManager().getShowEcpm().getSlotId()
vo["ecpm"] = it!!.getMediationManager().getShowEcpm().getEcpm()
......
......@@ -217,7 +217,8 @@ class MyExpressManager {
}
override fun onAdShow() {
if (it != null && it!!.getMediationManager().getShowEcpm() != null) {
if (it != null && it!!.getMediationManager()!=null
&& it!!.getMediationManager().getShowEcpm() != null) {
val vo = HashMap<String, Any>()
vo["adcode"] = it!!.getMediationManager().getShowEcpm().getSlotId()
vo["ecpm"] = it!!.getMediationManager().getShowEcpm().getEcpm()
......
......@@ -168,7 +168,8 @@ public class HalfScreenManager {
private final TTFullScreenVideoAd.FullScreenVideoAdInteractionListener mTTFullScreenAdListener = new TTFullScreenVideoAd.FullScreenVideoAdInteractionListener() {
@Override
public void onAdShow() {
if (mTtFullScreenVideoAd != null && mTtFullScreenVideoAd.getMediationManager().getShowEcpm() != null) {
if (mTtFullScreenVideoAd != null&& mTtFullScreenVideoAd.getMediationManager()!=null
&& mTtFullScreenVideoAd.getMediationManager().getShowEcpm() != null) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", mTtFullScreenVideoAd.getMediationManager().getShowEcpm().getSlotId());
vo.put("ecpm", mTtFullScreenVideoAd.getMediationManager().getShowEcpm().getEcpm());
......
......@@ -190,7 +190,7 @@ public class InMoneyVideo {
public void onAdShow() {
isRewardValid = false;
if (mttRewardAd != null && mttRewardAd.getMediationManager().getShowEcpm() != null) {
if (mttRewardAd != null&& mttRewardAd.getMediationManager()!=null && mttRewardAd.getMediationManager().getShowEcpm() != null) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", mttRewardAd.getMediationManager().getShowEcpm().getSlotId());
vo.put("ecpm", mttRewardAd.getMediationManager().getShowEcpm().getEcpm());
......
......@@ -129,7 +129,7 @@ public class InMoneyVideoNoPre {
adStatusListener.adSuccess();
}
if (mttRewardAd != null && mttRewardAd.getMediationManager().getShowEcpm() != null) {
if (mttRewardAd != null && mttRewardAd.getMediationManager()!=null && mttRewardAd.getMediationManager().getShowEcpm() != null) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode", mttRewardAd.getMediationManager().getShowEcpm().getSlotId());
vo.put("ecpm", mttRewardAd.getMediationManager().getShowEcpm().getEcpm());
......
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