Commit f984370d authored by mengcuiguang's avatar mengcuiguang

代码优化

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