Commit fbfb6e54 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent b4be1133
...@@ -183,7 +183,7 @@ public class VideoAdingManager { ...@@ -183,7 +183,7 @@ public class VideoAdingManager {
*/ */
private String getNextFailAdType() { private String getNextFailAdType() {
// 高额任务时 会为空 // 高额任务时 会为空
if (adList == null || currentRandomAdList == null) { if (isHighWeight || adList == null || currentRandomAdList == null) {
return getHighWeight(); return getHighWeight();
} }
...@@ -298,7 +298,7 @@ public class VideoAdingManager { ...@@ -298,7 +298,7 @@ public class VideoAdingManager {
weightList.clear(); weightList.clear();
} }
int weight = 0; int weight = 0;
// 若没有视频完成数,不加入权重计算范围内 // 穿山甲>优量汇>快手>oneway>闪电盒子>穿山甲全屏>珊瑚>枫岚(兜底)
if (AppConfig.csjVideoAdCount > 0) { if (AppConfig.csjVideoAdCount > 0) {
weightList.add(new WeightBean(csjVideoWeight, Constant.CSJ_VEDIO_AD)); weightList.add(new WeightBean(csjVideoWeight, Constant.CSJ_VEDIO_AD));
weight = weight + csjVideoWeight; weight = weight + csjVideoWeight;
...@@ -311,35 +311,35 @@ public class VideoAdingManager { ...@@ -311,35 +311,35 @@ public class VideoAdingManager {
LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight); LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight);
adList.add("b"); adList.add("b");
} }
if (AppConfig.csjFullVedioAdCount > 0) { if (AppConfig.ksVideoAdCount > 0) {
weightList.add(new WeightBean(csjFullVideoWeight, Constant.CSJ_FULL_AD)); weightList.add(new WeightBean(ksVideoWeight, Constant.KS_VEDIO_AD));
weight = weight + csjFullVideoWeight; weight = weight + ksVideoWeight;
LogUtil.d(TAG, "权重值:csjFullVideoWeight:" + csjFullVideoWeight); LogUtil.d(TAG, "权重值:ksWeight:" + ksVideoWeight);
adList.add("c"); adList.add("c");
} }
if (AppConfig.wnVideoAdCount > 0) { if (AppConfig.wnVideoAdCount > 0) {
weightList.add(new WeightBean(wnWeight, Constant.SDHZ_VEDIO_AD)); weightList.add(new WeightBean(wnWeight, Constant.SDHZ_VEDIO_AD));
weight = weight + wnWeight; weight = weight + wnWeight;
LogUtil.d(TAG, "权重值:sdhzWeight:" + wnWeight); LogUtil.d(TAG, "权重值:sdhzWeight:" + wnWeight);
adList.add("d"); adList.add("e");
}
if (AppConfig.csjFullVedioAdCount > 0) {
weightList.add(new WeightBean(csjFullVideoWeight, Constant.CSJ_FULL_AD));
weight = weight + csjFullVideoWeight;
LogUtil.d(TAG, "权重值:csjFullVideoWeight:" + csjFullVideoWeight);
adList.add("f");
} }
if (AppConfig.shVideoAdCount > 0) { if (AppConfig.shVideoAdCount > 0) {
weightList.add(new WeightBean(shVideoWeight, Constant.SH_VEDIO_AD)); weightList.add(new WeightBean(shVideoWeight, Constant.SH_VEDIO_AD));
weight = weight + shVideoWeight; weight = weight + shVideoWeight;
LogUtil.d(TAG, "权重值:shWeight:" + shVideoWeight); LogUtil.d(TAG, "权重值:shWeight:" + shVideoWeight);
adList.add("e"); adList.add("g");
}
if (AppConfig.ksVideoAdCount > 0) {
weightList.add(new WeightBean(ksVideoWeight, Constant.KS_VEDIO_AD));
weight = weight + ksVideoWeight;
LogUtil.d(TAG, "权重值:ksWeight:" + ksVideoWeight);
adList.add("f");
} }
if (AppConfig.flVideoAdCount > 0) { if (AppConfig.flVideoAdCount > 0) {
weightList.add(new WeightBean(flVideoWeight, Constant.FL_VEDIO_AD)); weightList.add(new WeightBean(flVideoWeight, Constant.FL_VEDIO_AD));
weight = weight + flVideoWeight; weight = weight + flVideoWeight;
LogUtil.d(TAG, "权重值:flVideoWeight:" + flVideoWeight); LogUtil.d(TAG, "权重值:flVideoWeight:" + flVideoWeight);
adList.add("g"); adList.add("h");
} }
// 权重随机 // 权重随机
...@@ -745,7 +745,8 @@ public class VideoAdingManager { ...@@ -745,7 +745,8 @@ public class VideoAdingManager {
} }
private String getCode(String adtype) { private String getCode(String adtype) {
String code = "g"; // 穿山甲>优量汇>快手>oneway>闪电盒子>穿山甲全屏>珊瑚>枫岚(兜底)
String code = "h";
switch (adtype) { switch (adtype) {
case Constant.CSJ_VEDIO_AD: case Constant.CSJ_VEDIO_AD:
code = "a"; code = "a";
...@@ -753,23 +754,25 @@ public class VideoAdingManager { ...@@ -753,23 +754,25 @@ public class VideoAdingManager {
case Constant.YLH_VEDIO_AD: case Constant.YLH_VEDIO_AD:
code = "b"; code = "b";
break; break;
case Constant.CSJ_FULL_AD: case Constant.KS_VEDIO_AD:
code = "c"; code = "c";
break; break;
case Constant.SDHZ_VEDIO_AD: case Constant.SDHZ_VEDIO_AD:
code = "d";
break;
case Constant.SH_VEDIO_AD:
code = "e"; code = "e";
break; break;
case Constant.KS_VEDIO_AD: case Constant.CSJ_FULL_AD:
code = "f"; code = "f";
break; break;
case Constant.SH_VEDIO_AD:
code = "g";
break;
} }
return code; return code;
} }
private String getAdtype(String code) { private String getAdtype(String code) {
//// 穿山甲>优量汇>快手>oneway>闪电盒子>穿山甲全屏>珊瑚>枫岚(兜底)
String adtype = Constant.FL_VEDIO_AD; String adtype = Constant.FL_VEDIO_AD;
switch (code) { switch (code) {
case "a": case "a":
...@@ -779,16 +782,16 @@ public class VideoAdingManager { ...@@ -779,16 +782,16 @@ public class VideoAdingManager {
adtype = Constant.YLH_VEDIO_AD; adtype = Constant.YLH_VEDIO_AD;
break; break;
case "c": case "c":
adtype = Constant.CSJ_FULL_AD; adtype = Constant.KS_VEDIO_AD;
break;
case "d":
adtype = Constant.SDHZ_VEDIO_AD;
break; break;
case "e": case "e":
adtype = Constant.SH_VEDIO_AD; adtype = Constant.SDHZ_VEDIO_AD;
break; break;
case "f": case "f":
adtype = Constant.KS_VEDIO_AD; adtype = Constant.CSJ_FULL_AD;
break;
case "g":
adtype = Constant.SH_VEDIO_AD;
break; break;
} }
return adtype; return adtype;
......
...@@ -466,6 +466,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -466,6 +466,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
readyGoThenKill(DrawcashActivity::class.java) readyGoThenKill(DrawcashActivity::class.java)
} }
4 -> {
showToast("视频加载异常,请稍后重试~")
}
} }
} }
R.id.tvAwardNext -> { R.id.tvAwardNext -> {
......
...@@ -1113,6 +1113,7 @@ class MyFragment : BaseFragment(), ...@@ -1113,6 +1113,7 @@ class MyFragment : BaseFragment(),
if (activity != null && !activity!!.isFinishing) { if (activity != null && !activity!!.isFinishing) {
// 高额任务 // 高额任务
if (TextUtils.equals(carrierType, Constant.CARRIER_HIGH_ACTIVITY)) { if (TextUtils.equals(carrierType, Constant.CARRIER_HIGH_ACTIVITY)) {
onDestroyBroadcastReceiver()
return return
} }
......
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