Commit 5623c54f authored by mengcuiguang's avatar mengcuiguang

解决冲突

parents 99b6b840 96064363
......@@ -341,8 +341,8 @@ dependencies {
implementation 'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:4.4.3'
api 'org.aspectj:aspectjrt:1.9.5'
//小满
implementation ("com.bx:adsdk:1.4.2.2"){
exclude group:"com.miit.sdk"
implementation("com.bx:adsdk:1.4.2.2") {
exclude group: "com.miit.sdk"
transitive = true
changing = true
}
......
package com.mints.goodmoney.ad.express
import android.annotation.SuppressLint
import android.content.DialogInterface
import android.text.TextUtils
import android.util.Log
import android.view.LayoutInflater
......@@ -95,7 +96,7 @@ object KsPreLoadExpressManager {
}
override fun onVideoPlayError(what: Int, extra: Int) {
LogUtil.d("KsPreLoadExpressManager","id=${what} extra=${extra}")
LogUtil.d("KsPreLoadExpressManager", "id=${what} extra=${extra}")
}
})
......@@ -191,6 +192,10 @@ object KsPreLoadExpressManager {
// Toast.makeText(mContext, "广告" + ad.appName + "展示", Toast.LENGTH_SHORT).show()
}
}
override fun handleDownloadDialog(p0: DialogInterface.OnClickListener?): Boolean {
return false
}
})
// 广告描述
......
......@@ -120,6 +120,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
}
}
override fun onRequestResult(p0: Int) {}
})
......
......@@ -6,8 +6,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.text.TextUtils;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.ad.video.base.VideoAdStatusListener;
import com.mints.goodmoney.common.AppConfig;
import com.mints.goodmoney.common.Constant;
......@@ -17,8 +15,6 @@ import com.mints.goodmoney.mvp.model.WeightBean;
import com.mints.goodmoney.service.AppInstallService;
import com.mints.goodmoney.utils.AppUtil;
import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.ToastUtil;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashSet;
......@@ -64,8 +60,6 @@ public class VideoAdingManager {
// 是否是高额视频任务
private boolean isHighWeight = false;
private boolean isTTVideoAd = false;
private int highIndex = 0;//0-穿山甲 1-优量汇 2-快手
private Activity activity;
private boolean isVideoAdDownload = false;// 是否点击广告下载 true-点击
......@@ -235,31 +229,52 @@ public class VideoAdingManager {
/**
* 高额任务广告类型
*
* @return _
* @return
*/
private String getHighWeight() {
// isTTVideoAd = !isTTVideoAd;
// if (isTTVideoAd) {
// return Constant.CSJ_VEDIO_AD;
// } else {
// return Constant.YLH_VEDIO_AD;
// }
String adType = "";
switch (highIndex) {
case 0:
highIndex = 1;
adType = Constant.CSJ_VEDIO_AD;
break;
case 1:
highIndex = 2;
adType = Constant.YLH_VEDIO_AD;
break;
case 2:
highIndex = 0;
adType = Constant.KS_VEDIO_AD;
break;
public String getHighWeight() {
int weight = 0;
if (weightList != null) {
weightList.clear();
}
return adType;
// 穿山甲
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 (AppConfig.ylhHighVideoAdCount > 0) {
weightList.add(new WeightBean(AppConfig.ylhHighVideoAdCount, Constant.YLH_VEDIO_AD));
weight = weight + AppConfig.ylhHighVideoAdCount;
LogUtil.d(TAG, "高额任务 -> 权重值:ylhVideoWeight:" + AppConfig.ylhHighVideoAdCount);
}
// 快手
if (AppConfig.ksHighVideoAdCount > 0) {
weightList.add(new WeightBean(AppConfig.ksHighVideoAdCount, Constant.KS_VEDIO_AD));
weight = weight + AppConfig.ksHighVideoAdCount;
LogUtil.d(TAG, "高额任务 -> 权重值:ksVideoWeight:" + AppConfig.ksHighVideoAdCount);
}
// 权重随机
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 Constant.CSJ_VEDIO_AD;
}
/**
......
......@@ -100,6 +100,20 @@ public class AppConfig {
* rtaVideo 剩余广告播放数
*/
public static int rtaVideoAdCount = 0;
/**
* 高额任务和超级翻倍 csjVideo 剩余广告播放数
*/
public static int csjHighVideoAdCount = 0;
/**
* 高额任务和超级翻倍 ylhVideo 剩余广告播放数
*/
public static int ylhHighVideoAdCount = 0;
/**
* 高额任务和超级翻倍 ksVideo 剩余广告播放数
*/
public static int ksHighVideoAdCount = 0;
/**
* 高额试玩任务标识
......
......@@ -23,6 +23,9 @@ object KsManager {
/* vedio-postid */
const val KS_AD_VEDIO_POSTID = 5746000022
/* 内容联盟id */
const val KS_CONTENT_POSTID = 5746000049
/**
* 初始化
*/
......
......@@ -13,6 +13,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;
......@@ -135,4 +136,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;
}
}
}
......@@ -425,6 +425,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
// 是否开启应用使用情况权限
if (AppUtil.isOpenUsageStats()) {
registerBroad()
videoAdingManager.setIsHighWeight(true)
awardVideo()
} else {
AppTryPlayManager.openAppUsageStats(this)
......
......@@ -29,6 +29,7 @@ class SplashKsADActivity : BaseActivity() {
* 记录拉取广告的时间
*/
private val handler = Handler(Looper.getMainLooper())
override fun getContentViewLayoutID(): Int {
return R.layout.activity_splash_ylh
}
......@@ -100,6 +101,8 @@ class SplashKsADActivity : BaseActivity() {
next()
}
override fun onRequestResult(p0: Int) {}
override fun onSplashScreenAdLoad(p0: KsSplashScreenAd?) {
LogUtil.d(TAG, "onSplashScreenAdLoad")
......
......@@ -324,6 +324,13 @@ class MyFragment : BaseFragment(),
return
}
// 高额任务及超级翻倍次数
if (data.highRatePlan != null) {
AppConfig.csjHighVideoAdCount = data.highRatePlan.csj
AppConfig.ylhHighVideoAdCount = data.highRatePlan.ylh
AppConfig.ksHighVideoAdCount = data.highRatePlan.ks
}
if (data.shareNews != null) {
AppConfig.wzReadCoin = data.shareNews.readCoin
}
......
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