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,18 +72,26 @@ object BannerManager { ...@@ -71,18 +72,26 @@ object BannerManager {
} }
override fun onAdShow(view: View?, type: Int) { override fun onAdShow(view: View?, type: Int) {
if (bannerAd != null && bannerAd!!.mediationManager.showEcpm != null) { try {
val vo = HashMap<String, Any>() if (bannerAd != null && bannerAd!!.mediationManager != null
vo["adcode"] = && bannerAd!!.mediationManager.showEcpm != null
bannerAd!!.mediationManager.showEcpm.slotId ) {
vo["ecpm"] = val vo = HashMap<String, Any>()
bannerAd!!.mediationManager.showEcpm.ecpm vo["adcode"] =
vo["adSource"] = bannerAd!!.mediationManager.showEcpm.slotId
bannerAd!!.mediationManager.showEcpm.sdkName vo["ecpm"] =
vo["adid"] = BuildConfig.GROMORE_BANNER_CODE bannerAd!!.mediationManager.showEcpm.ecpm
vo["adType"] = Constant.GRO_MORE_ADTYPE5 vo["adSource"] =
TrackManager.getInstance().reporGromeEcpm(vo) bannerAd!!.mediationManager.showEcpm.sdkName
vo["adid"] = BuildConfig.GROMORE_BANNER_CODE
vo["adType"] = Constant.GRO_MORE_ADTYPE5
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