Commit 3ad2018f authored by jyx's avatar jyx

高额任务修改百分比显示

parent 71861b14
......@@ -64,8 +64,7 @@ android {
// 不显示Log
buildConfigField "boolean", "LOG_DEBUG", "true"
buildConfigField "String", "AppKeyPre", "\"abcd\""
// buildConfigField "String", "MainIp", DEBUG_URL
buildConfigField "String", "MainIp", RELEASE_URL
buildConfigField "String", "MainIp", DEBUG_URL
manifestPlaceholders = [TD_SCHEMA_KEY: DEBUG_TD_SCHEMA_KEY,
TD_KEY : DEBUG_TD_KEY]
......
......@@ -7,7 +7,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.text.TextUtils;
import com.mints.goldspace.MintsApplication;
import com.mints.goldspace.ad.video.base.VideoAdStatusListener;
import com.mints.goldspace.common.AppConfig;
import com.mints.goldspace.common.Constant;
......@@ -17,8 +16,6 @@ import com.mints.goldspace.mvp.model.WeightBean;
import com.mints.goldspace.service.AppInstallService;
import com.mints.goldspace.utils.AppUtil;
import com.mints.goldspace.utils.LogUtil;
import com.mints.goldspace.utils.ToastUtil;
import com.mints.library.utils.json.JsonUtil;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
......@@ -55,11 +52,15 @@ public class VideoAdingManager {
private int ksVideoWeight;
private int owVideoWeight;
// 高额任务权重
private int csjHighVideoWeight;
private int ksHighVideoWeight;
private int ylhHighVideoWeight;
private ArrayList<WeightBean> weightList;
// 是否是高额视频任务
private boolean isHighWeight = false;
private boolean isTTVideoAd = false;
private Activity activity;
private boolean isVideoAdDownload = false;// 是否点击广告下载 true-点击
......@@ -82,7 +83,7 @@ public class VideoAdingManager {
/**
* 初始化广告manager
*
* @param activity
* @param activity
*/
private void init(Activity activity) {
this.activity = activity;
......@@ -158,6 +159,18 @@ public class VideoAdingManager {
this.owVideoWeight = owVideoWeight;
}
/**
* 初始化高额任务广告权重
*/
public void initHighAdWeight(
int csjVideoWeight,
int ylhWeight,
int ksVideoWeight) {
this.csjHighVideoWeight = csjVideoWeight;
this.ylhHighVideoWeight = ylhWeight;
this.ksHighVideoWeight = ksVideoWeight;
}
/**
* 根据类型加载对应视频(第一次加载)
*
......@@ -188,7 +201,7 @@ public class VideoAdingManager {
/**
* 根据广告优先级获取下一个
* <p>
*
* <p>
* 穿山甲>优量汇>快手>oneway>闪电盒子>穿山甲全屏>珊瑚>枫岚(兜底)
*/
private String getNextFailAdType() {
......@@ -243,14 +256,45 @@ public class VideoAdingManager {
*
* @return
*/
private String getHighWeight() {
isTTVideoAd = !isTTVideoAd;
if (isTTVideoAd) {
return Constant.CSJ_VEDIO_AD;
} else {
return Constant.YLH_VEDIO_AD;
public String getHighWeight() {
int weight = 0;
if (weightList != null) {
weightList.clear();
}
// 穿山甲
weightList.add(new WeightBean(csjHighVideoWeight, Constant.CSJ_VEDIO_AD));
weight = weight + csjHighVideoWeight;
LogUtil.d(TAG, "高额任务 -> 权重值:csjVideoWeight:" + csjHighVideoWeight);
// 优量汇
weightList.add(new WeightBean(ylhHighVideoWeight, Constant.YLH_VEDIO_AD));
weight = weight + ylhHighVideoWeight;
LogUtil.d(TAG, "高额任务 -> 权重值:ylhVideoWeight:" + ylhHighVideoWeight);
// 快手
weightList.add(new WeightBean(ksHighVideoWeight, Constant.KS_VEDIO_AD));
weight = weight + ksHighVideoWeight;
LogUtil.d(TAG, "高额任务 -> 权重值:ksVideoWeight:" + ksHighVideoWeight);
// 权重随机
if (weightList != null && weightList.size() > 0 && weight > 0) {
LogUtil.d(TAG, "高额任务 -> 1、权重总值:" + weight);
Random r = new Random();
int randomWeight = r.nextInt(weight) + 1;
LogUtil.d(TAG, "高额任务 -> 2、权重随机值:" + randomWeight);
for (WeightBean weightBean : weightList) {
randomWeight -= weightBean.getWeight();
if (randomWeight <= 0) {
LogUtil.d(TAG, "高额任务 -> 3、权重结果:" + weightBean.getType());
return weightBean.getType();
}
}
}
return "";
}
/**
* 根据权重获取广告类型
......@@ -721,7 +765,7 @@ public class VideoAdingManager {
});
ksVideoAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
}else if (TextUtils.equals(videoAdType, Constant.OW_VEDIO_AD)) {
} else if (TextUtils.equals(videoAdType, Constant.OW_VEDIO_AD)) {
// oneway广告激励视频
if (owVideoAdManager == null) {
if (activity == null) {
......
......@@ -15,10 +15,10 @@ object KsManager {
private const val KS_APP_ID = "574600004"
/*信息流*/
const val KS_AD_NATIVEEXPRESS_AWARD = 5746000025
const val KS_AD_NATIVEEXPRESS_AWARD = 5746000025L
/* vedio-postid */
const val KS_AD_VEDIO_POSTID = 5746000024
const val KS_AD_VEDIO_POSTID = 5746000024L
/**
* 初始化
......
......@@ -86,6 +86,7 @@ public class DrawcashBean implements Serializable {
private int YLH_VEDIO;
private int FL_VEDIO;
private int CORAL_VEDIO;
private int OW_VEDIO;
public int getKS_VEDIO() {
return KS_VEDIO;
......@@ -119,6 +120,10 @@ public class DrawcashBean implements Serializable {
public int getFL_VEDIO() {
return FL_VEDIO;
}
public int getOW_VEDIO() {
return OW_VEDIO;
}
}
public class CashOutMoneyArrBean implements Serializable {
......
......@@ -207,6 +207,41 @@ public class MyInfo implements Serializable {
private int coin;
private int readCoin;
private int needSeconds;
private RatePlanBean ratePlan;
public class RatePlanBean implements Serializable {
private int YLH;
private int KS;
private int CSJ;
public int getYLH() {
return YLH;
}
public void setYLH(int YLH) {
this.YLH = YLH;
}
public int getKS() {
return KS;
}
public void setKS(int KS) {
this.KS = KS;
}
public int getCSJ() {
return CSJ;
}
public void setCSJ(int CSJ) {
this.CSJ = CSJ;
}
}
public RatePlanBean getRatePlan() {
return ratePlan;
}
public String getDownloadUrl() {
return downloadUrl;
......
......@@ -304,7 +304,8 @@ class DrawcashActivity : BaseActivity(),
data.fL_VEDIO,
data.coraL_VEDIO,
data.csjfulL_VEDIO,
data.kS_VEDIO
data.kS_VEDIO,
data.oW_VEDIO
)
LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} " +
"ylhWeight:${data.ylH_VEDIO} " +
......@@ -312,7 +313,8 @@ class DrawcashActivity : BaseActivity(),
"csjFullWeight:${data.csjfulL_VEDIO} " +
"shWeight:${data.coraL_VEDIO} " +
"flWeight:${data.fL_VEDIO} " +
"ksWeight:${data.kS_VEDIO} ")
"ksWeight:${data.kS_VEDIO} " +
"owWeight:${data.oW_VEDIO} ")
// 广告视频数
AppConfig.csjVideoAdCount = 10
AppConfig.ylhAdCount = 10
......
......@@ -1327,6 +1327,11 @@ 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)
// 注册高额任务广播监听
......
......@@ -16,7 +16,7 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
DEBUG_URL="http://39.97.65.143:9082/api/"
DEBUG_URL="http://39.97.65.143:9082/api-gs/"
#DEBUG_URL="http://192.168.110.7:8101/"
RELEASE_URL="https://api.mints-id.com/gsnew-api/"
......
......@@ -5,4 +5,4 @@
# For customization when using a Version Control System, please read the
# header note.
#Tue May 18 10:39:00 CST 2021
sdk.dir=/Users/mcg/Library/Android/sdk
sdk.dir=/Users/Hello/Library/Android/sdk
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