Commit 91f3515e authored by mengcuiguang's avatar mengcuiguang

信息流代码优化

parent 179cc79f
package com.mints.goodmoney.ad.express
import android.widget.FrameLayout
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.manager.TtCsjAdManager
/**
* 能用信息流加载
*/
object ExpressManager {
fun loadExpress() {
if (AppConfig.groMoreVideoAdCount > 0) {
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
} else {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
}
}
fun getExpressFrameLayout(): FrameLayout? {
if (AppConfig.groMoreVideoAdCount > 0) {
return GroMoreCarrierExpressManager.instance.getADFrameLayout()
} else {
return TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout
}
}
}
\ No newline at end of file
......@@ -227,17 +227,33 @@ public class CsjGroMoreVideoAdManager extends BaseVideoAd {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_GROMORE, Constant.EVENT_TYPE_THREE, "", "");
TrackManager.getInstance().reportAddCoinMsg(activity, getAdMapVO(carrierType, Constant.AD_SOURCE_GROMORE, extraId, curCoin));
HashMap<String, Object> voTemp = getAdMapVO(carrierType, Constant.AD_SOURCE_GROMORE, extraId, curCoin);
if (mttRewardAd != null) {
voTemp.put("gromoreAdsource", mttRewardAd.getAdNetworkRitId());
}
TrackManager.getInstance().reportAddCoinMsg(activity, voTemp);
if (mttRewardAd != null) {
// LogUtil.d(TAG, "adNetworkPlatformId: " + mttRewardAd.getAdNetworkPlatformId()); //获取展示广告对应的adn的值 具体值见NetworkPlatformConst类 -3: 无权限 -2: 暂无数据
// LogUtil.d(TAG, "adNetworkRitId:" + mttRewardAd.getAdNetworkRitId()); //获取展示广告对应的代码位 具体值见NetworkPlatformConst类 "-3": 无权限 "-2"
// LogUtil.d(TAG, "preEcpm: " + mttRewardAd.getPreEcpm()); //获取展示广告预估ecpm价格,单位是分 具体值见NetworkPlatformConst类 "-3": 无权限 "-2": 暂无数据 "-1":平台未有填写的预估ecpm价格
/**
* SDK_NAME_NO_PERMISSION = -3; //无权限
* * SDK_NAME_NO_DATA = -2; //暂无数据
* * SDK_NAME_PANGLE = 1;
* * SDK_NAME_ADMOB = 2;
* * SDK_NAME_GDT = 3;
* * SDK_NAME_MT = 4;
* * SDK_NAME_UNITY = 5;
* * SDK_NAME_BAIDU = 6;
* * SDK_NAME_KS = 7;
* * SDK_NAME_SIGMOB = 8;
*/
HashMap<String, Object> vo = new HashMap<>();
vo.put("adcode",mttRewardAd.getAdNetworkRitId());
vo.put("ecpm",mttRewardAd.getPreEcpm());
vo.put("adSource",mttRewardAd.getAdNetworkPlatformId());
vo.put("adType",Constant.GRO_MORE_ADTYPE2);
vo.put("adcode", mttRewardAd.getAdNetworkRitId());
vo.put("ecpm", mttRewardAd.getPreEcpm());
vo.put("adSource", mttRewardAd.getAdNetworkPlatformId());
vo.put("adType", Constant.GRO_MORE_ADTYPE2);
TrackManager.getInstance().cmtGroMoreInfo(vo);
}
......
......@@ -3,7 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreCarrierExpressManager
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.model.MealBean
import com.mints.goodmoney.mvp.presenters.FoodSubsidyPresenter
......@@ -88,7 +88,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
// 预加载信息流
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
ExpressManager.loadExpress()
}
......@@ -97,12 +97,9 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
*/
private fun initExpress() {
try {
if (GroMoreCarrierExpressManager.instance.getADFrameLayout() != null) {
if (flSubsidykAd != null) {
flSubsidykAd.removeAllViews()
// flSubsidykAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
flSubsidykAd.addView(GroMoreCarrierExpressManager.instance.getADFrameLayout())
}
if (flSubsidykAd != null) {
flSubsidykAd.removeAllViews()
flSubsidykAd.addView(ExpressManager.getExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -5,11 +5,11 @@ import android.view.View
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreCarrierExpressManager
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MorningClockBean
import com.mints.goodmoney.mvp.model.VideoAdingBean
......@@ -184,12 +184,9 @@ class MorningClockActivity : BaseActivity(), View.OnClickListener, MorningClockV
*/
private fun initExpress() {
try {
if (GroMoreCarrierExpressManager.instance.getADFrameLayout() != null) {
if (flMorningClockAd != null) {
flMorningClockAd.removeAllViews()
// flMorningClockAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
flMorningClockAd.addView(GroMoreCarrierExpressManager.instance.getADFrameLayout())
}
if (flMorningClockAd != null) {
flMorningClockAd.removeAllViews()
flMorningClockAd.addView(ExpressManager.getExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -3,7 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreCarrierExpressManager
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.model.WalkBean
import com.mints.goodmoney.mvp.presenters.WalkPresenter
......@@ -99,7 +99,7 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
// 预加载信息流
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
ExpressManager.loadExpress()
}
/**
......@@ -107,12 +107,9 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
*/
private fun initExpress() {
try {
if (GroMoreCarrierExpressManager.instance.getADFrameLayout() != null) {
if (flWalkAd != null) {
flWalkAd.removeAllViews()
// flWalkAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
flWalkAd.addView(GroMoreCarrierExpressManager.instance.getADFrameLayout())
}
if (flWalkAd != null) {
flWalkAd.removeAllViews()
flWalkAd.addView(ExpressManager.getExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -3,7 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.GroMoreCarrierExpressManager
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.model.WaterBean
import com.mints.goodmoney.mvp.presenters.WaterPresenter
......@@ -68,8 +68,7 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
}
// 预加载信息流
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
ExpressManager.loadExpress()
}
override fun clickForWaterSuc(waterCoin: Int) {
......@@ -111,12 +110,9 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
*/
private fun initExpress() {
try {
if (GroMoreCarrierExpressManager.instance.getADFrameLayout() != null) {
if (flWaterAd != null) {
flWaterAd.removeAllViews()
// flWaterAd.addView(TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout)
flWaterAd.addView(GroMoreCarrierExpressManager.instance.getADFrameLayout())
}
if (flWaterAd != null) {
flWaterAd.removeAllViews()
flWaterAd.addView(ExpressManager.getExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
......
......@@ -19,10 +19,7 @@ import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.banner.BannerManager
import com.mints.goodmoney.ad.express.GroMoreCarrierExpressManager
import com.mints.goodmoney.ad.express.PreLoadExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager
import com.mints.goodmoney.ad.express.*
import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
......@@ -1013,12 +1010,12 @@ class MyFragment : BaseFragment(),
readyGo(XiaomanActivity::class.java, bundle)
}
Constant.HOT_ACTIVITY_WATER -> {
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
ExpressManager.loadExpress()
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
readyGo(WaterActivity::class.java)
}
Constant.HOT_ACTIVITY_WALK -> {
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
ExpressManager.loadExpress()
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
readyGo(WalkActivity::class.java)
}
......@@ -1029,7 +1026,7 @@ class MyFragment : BaseFragment(),
readyGo(LiebaoGameActivity::class.java)
}
Constant.HOT_ACTIVITY_MORNINGCLOCK -> {
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
ExpressManager.loadExpress()
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK)
readyGo(MorningClockActivity::class.java)
}
......@@ -1110,7 +1107,7 @@ class MyFragment : BaseFragment(),
readyGo(WrapperActivity::class.java, bundle)
}
Constant.HOT_ACTIVITY_EAT -> {
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
ExpressManager.loadExpress()
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
readyGo(FoodSubsidyActivity::class.java)
}
......
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