Commit 2ac1e17c authored by jyx's avatar jyx

超级翻倍及高额任务权重优化

parent 48f7cd88
......@@ -52,11 +52,6 @@ public class VideoAdingManager {
private int ksVideoWeight;
private int owVideoWeight;
// 高额任务权重
private int csjHighVideoWeight;
private int ksHighVideoWeight;
private int ylhHighVideoWeight;
private ArrayList<WeightBean> weightList;
// 是否是高额视频任务
......@@ -159,18 +154,6 @@ public class VideoAdingManager {
this.owVideoWeight = owVideoWeight;
}
/**
* 初始化高额任务广告权重
*/
public void initHighAdWeight(
int csjVideoWeight,
int ylhWeight,
int ksVideoWeight) {
this.csjHighVideoWeight = csjVideoWeight;
this.ylhHighVideoWeight = ylhWeight;
this.ksHighVideoWeight = ksVideoWeight;
}
/**
* 根据类型加载对应视频(第一次加载)
*
......@@ -265,24 +248,24 @@ public class VideoAdingManager {
}
// 穿山甲
if (csjHighVideoWeight > 0) {
weightList.add(new WeightBean(csjHighVideoWeight, Constant.CSJ_VEDIO_AD));
weight = weight + csjHighVideoWeight;
LogUtil.d(TAG, "高额任务 -> 权重值:csjVideoWeight:" + csjHighVideoWeight);
if (AppConfig.csjHighVideoAdCount > 0) {
weightList.add(new WeightBean(AppConfig.csjHighVideoAdCount, Constant.CSJ_VEDIO_AD));
weight = weight + AppConfig.csjHighVideoAdCount;
LogUtil.d(TAG, "高额任务 -> 权重值:csjVideoWeight:" + AppConfig.csjHighVideoAdCount);
}
// 优量汇
if (ylhHighVideoWeight > 0) {
weightList.add(new WeightBean(ylhHighVideoWeight, Constant.YLH_VEDIO_AD));
weight = weight + ylhHighVideoWeight;
LogUtil.d(TAG, "高额任务 -> 权重值:ylhVideoWeight:" + ylhHighVideoWeight);
if (AppConfig.ylhHighVideoAdCount > 0) {
weightList.add(new WeightBean(AppConfig.ylhHighVideoAdCount, Constant.YLH_VEDIO_AD));
weight = weight + AppConfig.ylhHighVideoAdCount;
LogUtil.d(TAG, "高额任务 -> 权重值:ylhVideoWeight:" + AppConfig.ylhHighVideoAdCount);
}
// 快手
if (ksHighVideoWeight > 0) {
weightList.add(new WeightBean(ksHighVideoWeight, Constant.KS_VEDIO_AD));
weight = weight + ksHighVideoWeight;
LogUtil.d(TAG, "高额任务 -> 权重值:ksVideoWeight:" + ksHighVideoWeight);
if (AppConfig.ksHighVideoAdCount > 0) {
weightList.add(new WeightBean(AppConfig.ksHighVideoAdCount, Constant.KS_VEDIO_AD));
weight = weight + AppConfig.ksHighVideoAdCount;
LogUtil.d(TAG, "高额任务 -> 权重值:ksVideoWeight:" + AppConfig.ksHighVideoAdCount);
}
// 权重随机
......
......@@ -97,6 +97,21 @@ public class AppConfig {
*/
public static int owVideoAdCount = 0;
/**
* 高额任务和超级翻倍 csjVideo 剩余广告播放数
*/
public static int csjHighVideoAdCount = 0;
/**
* 高额任务和超级翻倍 ylhVideo 剩余广告播放数
*/
public static int ylhHighVideoAdCount = 0;
/**
* 高额任务和超级翻倍 ksVideo 剩余广告播放数
*/
public static int ksHighVideoAdCount = 0;
/**
* 高额试玩任务标识
*/
......
......@@ -12,6 +12,7 @@ public class UserTaskMsgBean implements Serializable {
private UserRiskAppsBean userRiskApps;
private AdcodeBean adcode_v1 = null;
private FlowAdRulesBean flowAdRules;
private HighRatePlanBean highRatePlan;
private String ip;
private String channel;
......@@ -124,4 +125,30 @@ public class UserTaskMsgBean implements Serializable {
public FlowAdRulesBean getFlowAdRules() {
return flowAdRules;
}
public HighRatePlanBean getHighRatePlan() {
return highRatePlan;
}
public void setHighRatePlan(HighRatePlanBean highRatePlan) {
this.highRatePlan = highRatePlan;
}
public static class HighRatePlanBean implements Serializable {
private int YLH;
private int KS;
private int CSJ;
public int getYLH() {
return YLH;
}
public int getKS() {
return KS;
}
public int getCSJ() {
return CSJ;
}
}
}
......@@ -423,6 +423,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
// 是否开启应用使用情况权限
if (AppUtil.isOpenUsageStats()) {
registerBroad()
videoAdingManager.setIsHighWeight(true)
awardVideo()
} else {
AppTryPlayManager.openAppUsageStats(this)
......
......@@ -214,6 +214,13 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
userMsgBean = data
// 高额任务及超级翻倍次数
if (data.flowAdRules != null) {
AppConfig.csjHighVideoAdCount = data.highRatePlan.csj
AppConfig.ylhHighVideoAdCount = data.highRatePlan.ylh
AppConfig.ksHighVideoAdCount = data.highRatePlan.ks
}
if (userMsgBean?.shareNews != null) {
AppConfig.wzReadCoin = userMsgBean!!.shareNews.readCoin
}
......
package com.mints.goldspace.ui.fragment
import android.Manifest
import android.annotation.SuppressLint
import android.content.*
import android.os.Bundle
......@@ -15,7 +14,6 @@ import androidx.recyclerview.widget.DividerItemDecoration
import androidx.viewpager.widget.ViewPager
import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open
import com.mints.goldspace.BuildConfig
import com.mints.goldspace.MintsApplication
import com.mints.goldspace.R
import com.mints.goldspace.ad.banner.BannerManager
import com.mints.goldspace.ad.express.PreLoadExpressManager
......@@ -24,7 +22,6 @@ import com.mints.goldspace.ad.express.TTPreLoadExpressXmlyManager
import com.mints.goldspace.ad.video.VideoAdingManager
import com.mints.goldspace.common.AppConfig
import com.mints.goldspace.common.Constant
import com.mints.goldspace.common.DeviceInfo
import com.mints.goldspace.manager.*
import com.mints.goldspace.mvp.model.*
import com.mints.goldspace.mvp.presenters.MyPresenter
......@@ -44,13 +41,10 @@ import com.mints.goldspace.utils.*
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.CommonUtils
import com.mints.library.utils.GlideUtils
import com.mints.library.utils.json.JsonUtil
import com.mints.library.utils.nodoubleclick.AntiShake
import com.rd.animation.type.AnimationType
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.snail.antifake.jni.EmulatorDetectUtil
import com.tbruyelle.rxpermissions.RxPermissions
import kotlinx.android.synthetic.main.fragment_main_my.*
import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.item_fragment_main_my_clock.*
......@@ -312,6 +306,13 @@ class MyFragment : BaseFragment(),
AppConfig.wzReadCoin = data.shareNews.readCoin
}
// 高额任务及超级翻倍次数
if (data.flowAdRules != null) {
AppConfig.csjHighVideoAdCount = data.highRatePlan.csj
AppConfig.ylhHighVideoAdCount = data.highRatePlan.ylh
AppConfig.ksHighVideoAdCount = data.highRatePlan.ks
}
// 更新权重
UserWeight.initAdWeight(data)
......@@ -1327,11 +1328,6 @@ class MyFragment : BaseFragment(),
carrierType = Constant.CARRIER_HIGH_ACTIVITY
vedioAdingManager.setIsHighWeight(true)
vedioAdingManager.initHighAdWeight(
taskBean.otherConfig.ratePlan.csj,
taskBean.otherConfig.ratePlan.ylh,
taskBean.otherConfig.ratePlan.ks
)
awardVedio(taskBean.otherConfig.coin, Constant.CARRIER_HIGH_ACTIVITY)
// 注册高额任务广播监听
......
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