Commit d592711a authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 5b380996
...@@ -159,7 +159,7 @@ public class VedioAdingManager { ...@@ -159,7 +159,7 @@ public class VedioAdingManager {
if (isHighWeight) { if (isHighWeight) {
setVedioAdingListener(null); setVedioAdingListener(null);
adType = getHighWeight(); adType = getHighWeight();
} else { } else {
adType = getRandomWeight(); adType = getRandomWeight();
} }
isHighWeight = false; isHighWeight = false;
...@@ -178,42 +178,18 @@ public class VedioAdingManager { ...@@ -178,42 +178,18 @@ public class VedioAdingManager {
* @return * @return
*/ */
private String getHighWeight() { private String getHighWeight() {
int weight = 0; isTTVideoAd = !isTTVideoAd;
if (AppConfig.csjVedioAdCount > 0) { if (isTTVideoAd) {
weight = weight + csjVedioWeight; if (AppConfig.csjVedioAdCount <= 0) {
LogUtil.d(TAG, "权重值:csjVedioWeight:" + csjVedioWeight); return Constant.SDHZ_VEDIO_AD;
}
if (AppConfig.ylhAdCount > 0) {
weight = weight + ylhWeight;
LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight);
}
if (AppConfig.wnVedioAdCount > 0) {
weight = weight + wnWeight;
LogUtil.d(TAG, "权重值:wnWeight:" + wnWeight);
}
// 权重随机
if (weight > 0) {
isTTVideoAd = !isTTVideoAd;
if (isTTVideoAd) {
if (AppConfig.csjVedioAdCount > 0) {
return Constant.CSJ_VEDIO_AD;
} else if (AppConfig.ylhAdCount > 0) {
return Constant.YLH_VEDIO_AD;
} else {
return Constant.SDHZ_VEDIO_AD;
}
} else {
if (AppConfig.ylhAdCount > 0) {
return Constant.YLH_VEDIO_AD;
} else if (AppConfig.csjVedioAdCount > 0) {
return Constant.CSJ_VEDIO_AD;
} else {
return Constant.SDHZ_VEDIO_AD;
}
} }
return Constant.CSJ_VEDIO_AD;
} else {
if (AppConfig.ylhAdCount <= 0) {
return Constant.SDHZ_VEDIO_AD;
}
return Constant.YLH_VEDIO_AD;
} }
return "";
} }
/** /**
......
...@@ -125,7 +125,7 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView ...@@ -125,7 +125,7 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG_POSTID(); ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG_POSTID();
break; break;
} }
ToastUtil.show(MintsApplication.getContext(), "ylh vedio:" + ylhPostId); // ToastUtil.show(MintsApplication.getContext(), "ylh vedio:" + ylhPostId);
if (rewardVideoAD != null) { if (rewardVideoAD != null) {
rewardVideoAD = null; rewardVideoAD = null;
} }
......
...@@ -263,7 +263,9 @@ open class MyPresenter : BasePresenter<MyView>() { ...@@ -263,7 +263,9 @@ open class MyPresenter : BasePresenter<MyView>() {
override fun onNext(baseResponse: BaseResponse<Any>) { override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return if (isLinkView) return
when (baseResponse.status) { } when (baseResponse.status) {
200 -> getAutoUserHallBaseMsg()
}
} }
}) })
} }
......
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