Commit f977ef6b authored by mengcuiguang's avatar mengcuiguang

穿山甲全屏广告提交

parent c578f556
......@@ -28,11 +28,13 @@ public class VedioAdingManager {
private CsjVedioAdManager csjVedioAdManager;
private YlhVedioAdManager ylhVedioAdManager;
private MhVedioAdManager mhVedioAdManager;
private CsjFullVedioAdManager csjFullVedioAdManager;
private int wnWeight;
private int ylhWeight;
private int csjVedioWeight;
private int flVedioWeight;
private int csjFullVedioWeight;
private ArrayList<WeightBean> weightList;
// 是否是高额视频任务
......@@ -65,17 +67,20 @@ public class VedioAdingManager {
ylhVedioAdManager = YlhVedioAdManager.getInstance(activity);
wnVedioAdManager = WnVedioAdManager.Companion.getInstance(activity);
mhVedioAdManager = MhVedioAdManager.Companion.getInstance(activity);
csjFullVedioAdManager = CsjFullVedioAdManager.getInstance(activity);
weightList = new ArrayList<>();
}
/**
* 初始化广告权重
*/
public void initAdWeight(int csjVedioWeight, int ylhWeight, int wnWeight, int flVedioWeight) {
public void initAdWeight(int csjVedioWeight, int ylhWeight,
int wnWeight, int flVedioWeight, int csjFullVedioWeight) {
this.csjVedioWeight = csjVedioWeight;
this.ylhWeight = ylhWeight;
this.wnWeight = wnWeight;
this.flVedioWeight = flVedioWeight;
this.csjFullVedioWeight = csjFullVedioWeight;
}
/**
......@@ -144,6 +149,8 @@ public class VedioAdingManager {
nextAdType = Constant.CSJ_VEDIO_AD;
} else if (AppConfig.ylhAdCount > 0) {
nextAdType = Constant.YLH_VEDIO_AD;
} else if (AppConfig.csjFullVedioAdCount > 0) {
nextAdType = Constant.CSJ_FULL_AD;
} else {
nextAdType = Constant.FL_VEDIO_AD;
}
......@@ -206,6 +213,11 @@ public class VedioAdingManager {
weight = weight + ylhWeight;
LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight);
}
if (AppConfig.csjFullVedioAdCount > 0) {
weightList.add(new WeightBean(csjFullVedioWeight, Constant.CSJ_FULL_AD));
weight = weight + csjFullVedioWeight;
LogUtil.d(TAG, "权重值:csjFullVedioWeight:" + csjFullVedioWeight);
}
if (AppConfig.flVedioAdCount > 0) {
weightList.add(new WeightBean(flVedioWeight, Constant.FL_VEDIO_AD));
weight = weight + flVedioWeight;
......@@ -254,8 +266,10 @@ public class VedioAdingManager {
int ylhAdCount = AppConfig.ylhAdCount;
int wnAdCount = AppConfig.wnVedioAdCount;
int flVedioAdCount = AppConfig.flVedioAdCount;
int csjFullVedioAdCount = AppConfig.csjFullVedioAdCount;
if (ylhAdCount <= 0 && csjVedioAdCount <= 0 && wnAdCount <= 0 && flVedioAdCount <= 0) {
if (ylhAdCount <= 0 && csjVedioAdCount <= 0
&& wnAdCount <= 0 && flVedioAdCount <= 0&& csjFullVedioAdCount <= 0) {
// showToast("今日视频已看完,请明天再来吧");
return true;
}
......@@ -286,6 +300,11 @@ public class VedioAdingManager {
mhVedioAdManager.onDestory();
mhVedioAdManager = null;
}
if (csjFullVedioAdManager != null) {
csjFullVedioAdManager.setCsjFullVedioAdListener(null);
csjFullVedioAdManager.onDestory();
csjFullVedioAdManager = null;
}
activity = null;
}
......@@ -449,6 +468,40 @@ public class VedioAdingManager {
});
mhVedioAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
}else if (TextUtils.equals(vedioAdType, Constant.CSJ_FULL_AD)) {
// 穿山甲全屏视频
if (csjFullVedioAdManager == null) {
if (activity == null) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerError(Constant.CSJ_FULL_AD);
}
return;
}
csjFullVedioAdManager = CsjFullVedioAdManager.getInstance(activity);
}
csjFullVedioAdManager.setCsjFullVedioAdListener(new CsjFullVedioAdManager.CsjFullVedioAdListener() {
@Override
public void csjFullVedioAdFail() {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerFail(Constant.CSJ_FULL_AD);
}
}
@Override
public void csjFullVedioAdSuccess() {
AppConfig.csjFullVedioAdCount--;
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerSuccess(Constant.CSJ_FULL_AD);
}
}
@Override
public void csjFullVedioDownload() {
isVedioAdDownload = true;
}
});
csjFullVedioAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -75,6 +75,10 @@ public class AppConfig {
* flVedio 剩余广告播放数
*/
public static int flVedioAdCount = 5;
/**
* csjFull 剩余广告播放数
*/
public static int csjFullVedioAdCount = 5;
/**
* 高额试玩任务标识
......
......@@ -159,6 +159,7 @@ object Constant {
const val YLH_VEDIO_AD = "YLH_VEDIO_AD"
const val SDHZ_VEDIO_AD = "SDHZ_VEDIO_AD"
const val FL_VEDIO_AD = "Fl_VEDIO_AD"
const val CSJ_FULL_AD = "CSJFULL_VEDIO_AD"
// 游戏类型
......
......@@ -41,7 +41,7 @@ public class TtCsjAdManager {
public static String TT_AD_VEDIO_HOMEVEDIO = "945744137";// 首页视频翻倍
public static String TT_AD_VEDIO_SMALLHOMEVEDIO = "945744186";// 短视频翻倍
/*全屏视频*/
public static String TT_AD_FULLVEDIO_ALL = "";// 通用
public static String TT_AD_FULLVEDIO_ALL = "945752969";// 通用
/*信息流*/
public static String TT_AD_NATIVEEXPRESS_XMLY = "945700753";//喜马拉雅信息流
public static String TT_AD_NATIVEEXPRESS_AWARD = "945562047";//信息流弹窗
......
......@@ -81,6 +81,7 @@ public class DrawcashBean implements Serializable {
public class VedioRules implements Serializable {
private int SDHZ_VEDIO;
private int CSJFULL_VEDIO;
private int CSJ_VEDIO;
private int YLH_VEDIO;
private int FL_VEDIO;
......@@ -89,6 +90,10 @@ public class DrawcashBean implements Serializable {
return SDHZ_VEDIO;
}
public int getCSJFULL_VEDIO() {
return CSJFULL_VEDIO;
}
public int getCSJ_VEDIO() {
return CSJ_VEDIO;
}
......
......@@ -8,6 +8,7 @@ public class VedioRulesBean implements Serializable {
private YlhVedioBean YLH_VEDIO;
private SdhzVedioBean SDHZ_VEDIO;
private FLVedioBean FL_VEDIO;
private CsjfullVedioBean CSJFULL_VEDIO;
private boolean flVideoFlag;
public class CsjVedioBean implements Serializable {
......@@ -62,6 +63,19 @@ public class VedioRulesBean implements Serializable {
}
}
public class CsjfullVedioBean implements Serializable {
private int surplus;
private int rate;
public int getSurplus() {
return surplus;
}
public int getRate() {
return rate;
}
}
public FLVedioBean getFL_VEDIO() {
return FL_VEDIO;
}
......@@ -78,6 +92,10 @@ public class VedioRulesBean implements Serializable {
return SDHZ_VEDIO;
}
public CsjfullVedioBean getCSJFULL_VEDIO() {
return CSJFULL_VEDIO;
}
public boolean isFlVideoFlag() {
return flVideoFlag;
}
......
......@@ -299,14 +299,14 @@ class DrawcashActivity : BaseActivity(),
* 设置视频权重
*/
private fun initAdWeight(data: DrawcashBean.VedioRules) {
vedioAdingManager.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO, data.fL_VEDIO)
// vedioAdingManager?.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO)
LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} ylhWeight:${data.ylH_VEDIO} sdhzWeight:${data.sdhZ_VEDIO} flWeight:${data.fL_VEDIO}")
vedioAdingManager.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO, data.fL_VEDIO,data.csjfulL_VEDIO)
LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} ylhWeight:${data.ylH_VEDIO} sdhzWeight:${data.sdhZ_VEDIO} flWeight:${data.fL_VEDIO} csjfullWeight:${data.csjfulL_VEDIO}")
// 广告视频数
AppConfig.csjVedioAdCount = 10
AppConfig.ylhAdCount = 10
AppConfig.wnVedioAdCount = 10
AppConfig.flVedioAdCount = 10
AppConfig.csjFullVedioAdCount = 10
}
/**
......
......@@ -565,16 +565,18 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 设置视频权重
*/
private fun initAdWeight(data: UserTaskMsgBean) {
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate)
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate,
data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate, data.vedioRules.csjfulL_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate}" +
" sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate}")
" sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate} csjfulLWeight:${data.vedioRules.csjfulL_VEDIO.rate}")
// 广告视频数
AppConfig.csjVedioAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus
AppConfig.flVedioAdCount = data.vedioRules.fL_VEDIO.surplus
AppConfig.csjFullVedioAdCount = data.vedioRules.csjfulL_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount}" +
" sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount}")
" sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount} csjfullCount:${AppConfig.csjFullVedioAdCount}")
}
......
......@@ -18,6 +18,7 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.ad.banner.BannerManager
import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager
import com.mints.goodmoney.ad.vedio.CsjFullVedioAdManager
import com.mints.goodmoney.ad.vedio.VedioAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
......@@ -1046,14 +1047,18 @@ class MyFragment : BaseFragment(),
* 设置视频权重
*/
private fun initAdWeight(data: UserTaskMsgBean) {
vedioAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate}")
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate,
data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate, data.vedioRules.csjfulL_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate}" +
" sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate} csjfulLWeight:${data.vedioRules.csjfulL_VEDIO.rate}")
// 广告视频数
AppConfig.csjVedioAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus
AppConfig.flVedioAdCount = data.vedioRules.fL_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount} sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount}")
AppConfig.csjFullVedioAdCount = data.vedioRules.csjfulL_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount}" +
" sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount} csjfullCount:${AppConfig.csjFullVedioAdCount}")
}
/**
......
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