Commit d38ed85b authored by mengcuiguang's avatar mengcuiguang

添加ow 解决冲突

parents afbae991 f97edcaa
...@@ -349,6 +349,8 @@ dependencies { ...@@ -349,6 +349,8 @@ dependencies {
//愉悦赚 //愉悦赚
implementation(name: 'mduisdk_v3.1.0.18_support_msa_1.0.23', ext: 'aar') implementation(name: 'mduisdk_v3.1.0.18_support_msa_1.0.23', ext: 'aar')
implementation 'com.tencent.tbs.tbssdk:sdk:43903' implementation 'com.tencent.tbs.tbssdk:sdk:43903'
// OneWay
implementation(name: 'oneway-common-core-1.0.10', ext: 'aar')
// //芒果联盟 // //芒果联盟
// implementation 'com.openppeace.mgmob:mgmob:1.3.5-alpha6'//MGMob // implementation 'com.openppeace.mgmob:mgmob:1.3.5-alpha6'//MGMob
......
...@@ -17,6 +17,7 @@ import com.mints.goodmoney.manager.KsManager; ...@@ -17,6 +17,7 @@ import com.mints.goodmoney.manager.KsManager;
import com.mints.goodmoney.manager.LiebaoManager; import com.mints.goodmoney.manager.LiebaoManager;
import com.mints.goodmoney.manager.MhManager; import com.mints.goodmoney.manager.MhManager;
import com.mints.goodmoney.manager.MiitHelper; import com.mints.goodmoney.manager.MiitHelper;
import com.mints.goodmoney.manager.OwManager;
import com.mints.goodmoney.manager.ReaderManager; import com.mints.goodmoney.manager.ReaderManager;
import com.mints.goodmoney.manager.RsNewsManager; import com.mints.goodmoney.manager.RsNewsManager;
import com.mints.goodmoney.manager.TtCsjAdManager; import com.mints.goodmoney.manager.TtCsjAdManager;
...@@ -115,7 +116,7 @@ public class MintsApplication extends MultiDexApplication { ...@@ -115,7 +116,7 @@ public class MintsApplication extends MultiDexApplication {
private void thirdConfig() { private void thirdConfig() {
// 友盟SDK预初始化函数 // 友盟SDK预初始化函数
// preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验 // preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验
UMConfigure.preInit(this,CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")); UMConfigure.preInit(this, CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"));
// 初始化toast // 初始化toast
initToast(); initToast();
...@@ -141,6 +142,9 @@ public class MintsApplication extends MultiDexApplication { ...@@ -141,6 +142,9 @@ public class MintsApplication extends MultiDexApplication {
// 枫岚广告 // 枫岚广告
MhManager.INSTANCE.initMn(this); MhManager.INSTANCE.initMn(this);
// OneWay
OwManager.INSTANCE.init(this);
// 天卓珊瑚[INSTANCE是设置单例模式] // 天卓珊瑚[INSTANCE是设置单例模式]
TzManager.INSTANCE.initTz(this); TzManager.INSTANCE.initTz(this);
......
package com.mints.goodmoney.ad.video
import android.app.Activity
import com.mints.goodmoney.ad.video.base.BaseVideoAd
import com.mints.goodmoney.ad.video.base.VideoAdStatusListener
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.OwManager
import com.mints.goodmoney.manager.TrackManager
import mobi.oneway.export.Ad.OWRewardedAd
import mobi.oneway.export.AdListener.OWRewardedAdListener
import mobi.oneway.export.enums.OnewayAdCloseType
import mobi.oneway.export.enums.OnewaySdkError
private val TAG = OwVideoAdManager::class.java.simpleName
/**
* OneWay广告视频
*/
class OwVideoAdManager private constructor() :
BaseVideoAd() {
private var videoAdStatusListener: VideoAdStatusListener? = null
private var owRewardedAd: OWRewardedAd? = null
private var isClickScreen: Boolean = true
companion object {
private var _inst: OwVideoAdManager? = null
fun getInstance(): OwVideoAdManager? {
return if (_inst != null) {
_inst
} else {
_inst = OwVideoAdManager()
_inst
}
}
}
override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) {
isClickScreen = true
//创建激励视频事件监听器
val owRewardedAdListener: OWRewardedAdListener = object : OWRewardedAdListener {
override fun onAdReady() {
owRewardedAd?.show(activity)
}
override fun onAdShow(tag: String) {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_ZERO, "", "")
}
override fun onAdClick(tag: String) {
if (AppConfig.needReportClickAdEvent) {
TrackManager.getInstance().reportClickAdEvent()
}
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_TWO, "", "")
if (isClickScreen) {
// 防止重复
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_FOUR, "", "")
isClickScreen = false
}
videoAdStatusListener?.adDownload()
}
override fun onAdClose(tag: String, onewayVideoCloseType: OnewayAdCloseType) {
TrackManager.getInstance().reportAddCoinMsg(activity, getAdMapVO(carrierType, Constant.AD_SOURCE_OW, extraId, curCoin))
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_THREE, "", "")
videoAdStatusListener?.adSuccess()
}
override fun onAdFinish(s: String, onewayAdCloseType: OnewayAdCloseType, s1: String) {
}
override fun onSdkError(onewaySdkError: OnewaySdkError, msg: String) {
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_OW, Constant.EVENT_TYPE_ONE, "999999","emun:"+onewaySdkError.name+"msg:"+ msg)
videoAdStatusListener?.adFail()
}
}
//创建激励视频对象
owRewardedAd = OWRewardedAd(activity, OwManager.REWARD_PID, owRewardedAdListener)
owRewardedAd?.loadAd()
}
fun setVideoAdStatusListener(videoAdStatusListener: VideoAdStatusListener?) {
this.videoAdStatusListener = videoAdStatusListener
}
override fun onDestroy() {
owRewardedAd?.destory()
owRewardedAd = null
}
}
\ No newline at end of file
...@@ -6,6 +6,7 @@ import android.content.Context; ...@@ -6,6 +6,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.text.TextUtils; import android.text.TextUtils;
import com.mints.goodmoney.ad.video.base.VideoAdStatusListener; import com.mints.goodmoney.ad.video.base.VideoAdStatusListener;
import com.mints.goodmoney.common.AppConfig; import com.mints.goodmoney.common.AppConfig;
import com.mints.goodmoney.common.Constant; import com.mints.goodmoney.common.Constant;
...@@ -15,6 +16,7 @@ import com.mints.goodmoney.mvp.model.WeightBean; ...@@ -15,6 +16,7 @@ import com.mints.goodmoney.mvp.model.WeightBean;
import com.mints.goodmoney.service.AppInstallService; import com.mints.goodmoney.service.AppInstallService;
import com.mints.goodmoney.utils.AppUtil; import com.mints.goodmoney.utils.AppUtil;
import com.mints.goodmoney.utils.LogUtil; import com.mints.goodmoney.utils.LogUtil;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
...@@ -30,9 +32,6 @@ public class VideoAdingManager { ...@@ -30,9 +32,6 @@ public class VideoAdingManager {
private static VideoAdingManager _inst; private static VideoAdingManager _inst;
// APP下载回调广播
private BroadcastReceiver mReceiverBroadcastReceiver = null;
private VideoAdingListener videoAdingListener; private VideoAdingListener videoAdingListener;
private WnVideoAdManager wnVideoAdManager; private WnVideoAdManager wnVideoAdManager;
...@@ -42,8 +41,8 @@ public class VideoAdingManager { ...@@ -42,8 +41,8 @@ public class VideoAdingManager {
private ShVideoAdManager shVideoAdManager; private ShVideoAdManager shVideoAdManager;
private CsjFullVideoAdManager csjFullVideoAdManager; private CsjFullVideoAdManager csjFullVideoAdManager;
private KsVideoAdManager ksVideoAdManager; private KsVideoAdManager ksVideoAdManager;
private RTAVideoAdManager rtaVideoAdManager;
private CsjGroMoreVideoAdManager csjGroMoreVideoAdManager; private CsjGroMoreVideoAdManager csjGroMoreVideoAdManager;
private OwVideoAdManager owVideoAdManager;
private int wnWeight; private int wnWeight;
private int ylhWeight; private int ylhWeight;
...@@ -52,20 +51,20 @@ public class VideoAdingManager { ...@@ -52,20 +51,20 @@ public class VideoAdingManager {
private int shVideoWeight; private int shVideoWeight;
private int csjFullVideoWeight; private int csjFullVideoWeight;
private int ksVideoWeight; private int ksVideoWeight;
private int rtaVideoWeight;
private int groMoreWeight; private int groMoreWeight;
private int owVideoWeight;
private ArrayList<WeightBean> weightList; private ArrayList<WeightBean> weightList;
private ArrayList<String> currentRandomAdList;//当前随机出的广告渠道
private ArrayList<String> adList;//广告渠道
// 是否是高额视频任务 // 是否是高额视频任务
private boolean isHighWeight = false; private boolean isHighWeight = false;
private Activity activity; private Activity activity;
private boolean isVideoAdDownload = false;// 是否点击广告下载 true-点击 private boolean isVideoAdDownload = false;// 是否点击广告下载 true-点击
private ArrayList<String> currentRandomAdList;//当前随机出的广告渠道
private ArrayList<String> adList;//广告渠道
public static VideoAdingManager getInstance(Activity activity) { public static VideoAdingManager getInstance(Activity activity) {
if (_inst == null) { if (_inst == null) {
WeakReference<Activity> activityWeakReference = new WeakReference<>(activity); WeakReference<Activity> activityWeakReference = new WeakReference<>(activity);
...@@ -81,22 +80,25 @@ public class VideoAdingManager { ...@@ -81,22 +80,25 @@ public class VideoAdingManager {
/** /**
* 初始化广告manager * 初始化广告manager
* *
* @param activity _ * @param activity
*/ */
private void init(Activity activity) { private void init(Activity activity) {
this.activity = activity; this.activity = activity;
csjVideoAdManager = CsjVideoAdManager.getInstance(activity); csjVideoAdManager = CsjVideoAdManager.getInstance(activity);
ylhVideoAdManager = YlhVideoAdManager.getInstance(); ylhVideoAdManager = YlhVideoAdManager.getInstance();
csjFullVideoAdManager = CsjFullVideoAdManager.getInstance(activity);
wnVideoAdManager = WnVideoAdManager.Companion.getInstance(activity); wnVideoAdManager = WnVideoAdManager.Companion.getInstance(activity);
mhVideoAdManager = MhVideoAdManager.Companion.getInstance(activity); mhVideoAdManager = MhVideoAdManager.Companion.getInstance(activity);
shVideoAdManager = ShVideoAdManager.Companion.getInstance(activity); shVideoAdManager = ShVideoAdManager.Companion.getInstance(activity);
csjFullVideoAdManager = CsjFullVideoAdManager.getInstance(activity);
ksVideoAdManager = KsVideoAdManager.Companion.getInstance(activity); ksVideoAdManager = KsVideoAdManager.Companion.getInstance(activity);
rtaVideoAdManager = RTAVideoAdManager.Companion.getInstance(activity);
csjGroMoreVideoAdManager = CsjGroMoreVideoAdManager.getInstance(activity); csjGroMoreVideoAdManager = CsjGroMoreVideoAdManager.getInstance(activity);
owVideoAdManager = OwVideoAdManager.Companion.getInstance();
weightList = new ArrayList<>(); weightList = new ArrayList<>();
} }
// APP下载回调广播
private BroadcastReceiver mReceiverBroadcastReceiver = null;
private void registerBroad() { private void registerBroad() {
if (AppConfig.isSuperTask) { if (AppConfig.isSuperTask) {
return; return;
...@@ -136,10 +138,15 @@ public class VideoAdingManager { ...@@ -136,10 +138,15 @@ public class VideoAdingManager {
/** /**
* 初始化广告权重 * 初始化广告权重
*/ */
public void initAdWeight(int csjVideoWeight, int ylhWeight, public void initAdWeight(
int wnWeight, int flVideoWeight, int csjVideoWeight,
int shVideoWeight, int csjFullVideoWeight, int ylhWeight,
int ksVideoWeight, int rtaVideoWeight, int groMoreWeight) { int wnWeight,
int flVideoWeight,
int shVideoWeight,
int csjFullVideoWeight,
int ksVideoWeight, int groMoreWeight,
int owVideoWeight) {
this.csjVideoWeight = csjVideoWeight; this.csjVideoWeight = csjVideoWeight;
this.ylhWeight = ylhWeight; this.ylhWeight = ylhWeight;
this.wnWeight = wnWeight; this.wnWeight = wnWeight;
...@@ -147,14 +154,14 @@ public class VideoAdingManager { ...@@ -147,14 +154,14 @@ public class VideoAdingManager {
this.shVideoWeight = shVideoWeight; this.shVideoWeight = shVideoWeight;
this.csjFullVideoWeight = csjFullVideoWeight; this.csjFullVideoWeight = csjFullVideoWeight;
this.ksVideoWeight = ksVideoWeight; this.ksVideoWeight = ksVideoWeight;
this.rtaVideoWeight = rtaVideoWeight;
this.groMoreWeight = groMoreWeight; this.groMoreWeight = groMoreWeight;
this.owVideoWeight = owVideoWeight;
} }
/** /**
* 根据类型加载对应视频(第一次加载) * 根据类型加载对应视频(第一次加载)
* *
* @param bean _ * @param bean
*/ */
public void loadAding(Activity activity, VideoAdingBean bean) { public void loadAding(Activity activity, VideoAdingBean bean) {
WeakReference<Activity> activityWeakReference = new WeakReference<>(activity); WeakReference<Activity> activityWeakReference = new WeakReference<>(activity);
...@@ -165,14 +172,28 @@ public class VideoAdingManager { ...@@ -165,14 +172,28 @@ public class VideoAdingManager {
loadAdVideo(getVideoAdType(), bean); loadAdVideo(getVideoAdType(), bean);
} }
/**
* 加载失败优先级对应视频
*
* @param bean
*/
public void loadFailAding(Activity activity, VideoAdingBean bean) {
WeakReference<Activity> activityWeakReference = new WeakReference<>(activity);
this.activity = activityWeakReference.get();
isVideoAdDownload = false;
loadAdVideo(getNextFailAdType(), bean);
}
/** /**
* 根据广告优先级获取下一个 * 根据广告优先级获取下一个
* <p> * <p>
* 穿山甲>优量汇>穿山甲全屏>快手>珊瑚>闪电盒子>枫岚(兜底) * <p>
* 穿山甲>优量汇>快手>oneway>闪电盒子>穿山甲全屏>珊瑚>枫岚(兜底)
*/ */
private String getNextFailAdType() { private String getNextFailAdType() {
// 高额任务时 会为空 // 高额任务时 会为空
if (adList == null || currentRandomAdList == null) { if (isHighWeight || adList == null || currentRandomAdList == null) {
return getHighWeight(); return getHighWeight();
} }
...@@ -192,19 +213,6 @@ public class VideoAdingManager { ...@@ -192,19 +213,6 @@ public class VideoAdingManager {
return nextAdType; return nextAdType;
} }
/**
* 加载失败优先级对应视频
*
* @param bean _
*/
public void loadFailAding(Activity activity, VideoAdingBean bean) {
WeakReference<Activity> activityWeakReference = new WeakReference<>(activity);
this.activity = activityWeakReference.get();
isVideoAdDownload = false;
loadAdVideo(getNextFailAdType(), bean);
}
/** /**
* 获取广告类型配置 * 获取广告类型配置
*/ */
...@@ -284,7 +292,7 @@ public class VideoAdingManager { ...@@ -284,7 +292,7 @@ public class VideoAdingManager {
/** /**
* 根据权重获取广告类型 * 根据权重获取广告类型
* *
* @return _ * @return
*/ */
private String getRandomWeight() { private String getRandomWeight() {
if (currentRandomAdList == null) { if (currentRandomAdList == null) {
...@@ -300,8 +308,8 @@ public class VideoAdingManager { ...@@ -300,8 +308,8 @@ 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;
...@@ -314,51 +322,51 @@ public class VideoAdingManager { ...@@ -314,51 +322,51 @@ public class VideoAdingManager {
LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight); LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight);
adList.add("b"); adList.add("b");
} }
if (AppConfig.csjFullVideoAdCount > 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.owVideoAdCount > 0) {
weightList.add(new WeightBean(owVideoWeight, Constant.OW_VEDIO_AD));
weight = weight + owVideoWeight;
LogUtil.d(TAG, "权重值:owVideoWeight:" + owVideoWeight);
adList.add("d");
}
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.csjFullVideoAdCount > 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");
}
if (AppConfig.rtaVideoAdCount > 0) {
weightList.add(new WeightBean(rtaVideoWeight, Constant.RTA_VEDIO_AD));
weight = weight + rtaVideoWeight;
LogUtil.d(TAG, "权重值:rtaWeight:" + rtaVideoWeight);
} }
// 权重随机 // 权重随机
if (weightList != null && weightList.size() > 0 && weight > 0) { if (weightList != null && weightList.size() > 0 && weight > 0) {
LogUtil.d(TAG, "1、权重总值:" + weight); LogUtil.d(TAG, "1、权重总值:" + weight);
Random r = new Random(); Random r = new Random();
int randomWeight = r.nextInt(weight) + 1; int randomWeight = r.nextInt(weight) + 1;
LogUtil.d(TAG, "2、权重随机值:" + randomWeight); LogUtil.d(TAG, "2、权重随机值:" + randomWeight);
// ToastUtil.show(MintsApplication.getContext(),"权重随机值:" + randomWeight);
// ToastUtil.show(MintsApplication.getContext(), "权重随机值:" + randomWeight);
for (WeightBean weightBean : weightList) { for (WeightBean weightBean : weightList) {
randomWeight -= weightBean.getWeight(); randomWeight -= weightBean.getWeight();
if (randomWeight <= 0) { if (randomWeight <= 0) {
...@@ -390,19 +398,12 @@ public class VideoAdingManager { ...@@ -390,19 +398,12 @@ public class VideoAdingManager {
int wnAdCount = AppConfig.wnVideoAdCount; int wnAdCount = AppConfig.wnVideoAdCount;
int flVideoAdCount = AppConfig.flVideoAdCount; int flVideoAdCount = AppConfig.flVideoAdCount;
int tzVideoAdCount = AppConfig.shVideoAdCount; int tzVideoAdCount = AppConfig.shVideoAdCount;
int csjFullVedioAdCount = AppConfig.csjFullVideoAdCount;
int ksVideoAdCount = AppConfig.ksVideoAdCount; int ksVideoAdCount = AppConfig.ksVideoAdCount;
int csjFullVideoAdCount = AppConfig.csjFullVideoAdCount; int owVideoAdCount = AppConfig.owVideoAdCount;
int groMoreVideoAdCount = AppConfig.groMoreVideoAdCount; int groMoreVideoAdCount = AppConfig.groMoreVideoAdCount;
if (ylhAdCount <= 0 && csjVideoAdCount <= 0 && wnAdCount <= 0 && groMoreVideoAdCount <= 0 && flVideoAdCount <= 0
if (ylhAdCount <= 0 && && tzVideoAdCount <= 0 && csjFullVedioAdCount <= 0 && ksVideoAdCount <= 0 && owVideoAdCount <= 0) {
csjVideoAdCount <= 0 &&
wnAdCount <= 0 &&
flVideoAdCount <= 0 &&
tzVideoAdCount <= 0 &&
csjFullVideoAdCount <= 0 &&
groMoreVideoAdCount <= 0 &&
ksVideoAdCount <= 0) {
// showToast("今日视频已看完,请明天再来吧");
return true; return true;
} }
return false; return false;
...@@ -442,15 +443,10 @@ public class VideoAdingManager { ...@@ -442,15 +443,10 @@ public class VideoAdingManager {
shVideoAdManager.onDestroy(); shVideoAdManager.onDestroy();
shVideoAdManager = null; shVideoAdManager = null;
} }
if (ksVideoAdManager != null) { if (owVideoAdManager != null) {
ksVideoAdManager.setVideoAdStatusListener(null); owVideoAdManager.setVideoAdStatusListener(null);
ksVideoAdManager.onDestroy(); owVideoAdManager.onDestroy();
ksVideoAdManager = null; owVideoAdManager = null;
}
if (rtaVideoAdManager != null) {
rtaVideoAdManager.setVideoAdStatusListener(null);
rtaVideoAdManager.onDestroy();
rtaVideoAdManager = null;
} }
if (csjGroMoreVideoAdManager != null) { if (csjGroMoreVideoAdManager != null) {
csjGroMoreVideoAdManager.setVideoAdStatusListener(null); csjGroMoreVideoAdManager.setVideoAdStatusListener(null);
...@@ -771,30 +767,30 @@ public class VideoAdingManager { ...@@ -771,30 +767,30 @@ public class VideoAdingManager {
}); });
ksVideoAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId()); ksVideoAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
} else if (TextUtils.equals(videoAdType, Constant.RTA_VEDIO_AD)) { } else if (TextUtils.equals(videoAdType, Constant.OW_VEDIO_AD)) {
// RTA广告激励视频 // oneway广告激励视频
if (rtaVideoAdManager == null) { if (owVideoAdManager == null) {
if (activity == null) { if (activity == null) {
if (videoAdingListener != null) { if (videoAdingListener != null) {
videoAdingListener.videoAdingListenerError(Constant.RTA_VEDIO_AD); videoAdingListener.videoAdingListenerError(Constant.OW_VEDIO_AD);
} }
return; return;
} }
rtaVideoAdManager = RTAVideoAdManager.Companion.getInstance(activity); owVideoAdManager = OwVideoAdManager.Companion.getInstance();
} }
rtaVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() { owVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() {
@Override @Override
public void adSuccess() { public void adSuccess() {
AppConfig.rtaVideoAdCount--; AppConfig.owVideoAdCount--;
if (videoAdingListener != null) { if (videoAdingListener != null) {
videoAdingListener.videoAdingListenerSuccess(Constant.RTA_VEDIO_AD); videoAdingListener.videoAdingListenerSuccess(Constant.OW_VEDIO_AD);
} }
} }
@Override @Override
public void adFail() { public void adFail() {
if (videoAdingListener != null) { if (videoAdingListener != null) {
videoAdingListener.videoAdingListenerFail(Constant.RTA_VEDIO_AD); videoAdingListener.videoAdingListenerFail(Constant.OW_VEDIO_AD);
} }
} }
...@@ -806,9 +802,8 @@ public class VideoAdingManager { ...@@ -806,9 +802,8 @@ public class VideoAdingManager {
registerBroad(); registerBroad();
} }
}); });
owVideoAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
rtaVideoAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId()); } else if (TextUtils.equals(videoAdType, Constant.GROMORE_VEDIO_AD)) {
}else if (TextUtils.equals(videoAdType, Constant.GROMORE_VEDIO_AD)) {
// GROMORE广告激励视频 // GROMORE广告激励视频
if (csjGroMoreVideoAdManager == null) { if (csjGroMoreVideoAdManager == null) {
if (activity == null) { if (activity == null) {
...@@ -855,7 +850,8 @@ public class VideoAdingManager { ...@@ -855,7 +850,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";
...@@ -863,23 +859,28 @@ public class VideoAdingManager { ...@@ -863,23 +859,28 @@ 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.OW_VEDIO_AD:
code = "d"; code = "d";
break; break;
case Constant.SH_VEDIO_AD: case Constant.SDHZ_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":
...@@ -889,16 +890,19 @@ public class VideoAdingManager { ...@@ -889,16 +890,19 @@ 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; break;
case "d": case "d":
adtype = Constant.SDHZ_VEDIO_AD; adtype = Constant.OW_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;
......
...@@ -97,9 +97,14 @@ public class AppConfig { ...@@ -97,9 +97,14 @@ public class AppConfig {
*/ */
public static int ksVideoAdCount = 0; public static int ksVideoAdCount = 0;
/** /**
* rtaVideo 剩余广告播放数 * owVideo 剩余广告播放数
*/ */
public static int rtaVideoAdCount = 0; public static int owVideoAdCount = 0;
// /**
// * rtaVideo 剩余广告播放数
// */
// public static int rtaVideoAdCount = 0;
/** /**
* gromore 剩余广告播放数 * gromore 剩余广告播放数
*/ */
......
...@@ -156,6 +156,7 @@ object Constant { ...@@ -156,6 +156,7 @@ object Constant {
const val AD_SOURCE_SH = "CORAL" //珊瑚天卓 const val AD_SOURCE_SH = "CORAL" //珊瑚天卓
const val AD_SOURCE_KS = "KS" //快手 const val AD_SOURCE_KS = "KS" //快手
const val AD_SOURCE_RTA = "RTA" //RTA const val AD_SOURCE_RTA = "RTA" //RTA
const val AD_SOURCE_OW = "OW" //OneWay
// 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重 // 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
const val EVENT_TYPE_ZERO = "0" const val EVENT_TYPE_ZERO = "0"
...@@ -179,6 +180,7 @@ object Constant { ...@@ -179,6 +180,7 @@ object Constant {
const val KS_VEDIO_AD = "KS_VEDIO_AD" const val KS_VEDIO_AD = "KS_VEDIO_AD"
const val RTA_VEDIO_AD = "RTA_VEDIO_AD" const val RTA_VEDIO_AD = "RTA_VEDIO_AD"
const val GROMORE_VEDIO_AD = "GROMORE_VEDIO_AD" const val GROMORE_VEDIO_AD = "GROMORE_VEDIO_AD"
const val OW_VEDIO_AD = "OW_VEDIO_AD"
// 信息流广告类型 // 信息流广告类型
const val CSJ_EXPRESS_AD = "CSJ_EXPRESS_AD" const val CSJ_EXPRESS_AD = "CSJ_EXPRESS_AD"
......
package com.mints.goodmoney.manager
import android.app.Application
import com.maplehaze.adsdk.MaplehazeSDK
import mobi.oneway.export.Ad.OnewaySdk
/**
* 描述:OneWay激励视频
* 作者:孟崔广
*/
object OwManager {
private const val PUBLISH_ID = ""
const val REWARD_PID = ""
/**
* 初始化
*/
fun init(application: Application) {
OnewaySdk.configure(application, PUBLISH_ID)
}
}
\ No newline at end of file
...@@ -27,8 +27,8 @@ object UserWeight { ...@@ -27,8 +27,8 @@ object UserWeight {
data.vedioRules.corAl_VIDEO.rate, data.vedioRules.corAl_VIDEO.rate,
data.vedioRules.csjfulL_VEDIO.rate, data.vedioRules.csjfulL_VEDIO.rate,
data.vedioRules.kS_VEDIO.rate, data.vedioRules.kS_VEDIO.rate,
data.vedioRules.rtA_VEDIO.rate, data.vedioRules.gromorE_VEDIO.rate,
data.vedioRules.gromorE_VEDIO.rate data.vedioRules.oW_VEDIO.rate
) )
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " + LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " +
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " + "ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " +
...@@ -36,8 +36,8 @@ object UserWeight { ...@@ -36,8 +36,8 @@ object UserWeight {
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " + "csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " +
"shWeight:${data.vedioRules.corAl_VIDEO.rate} " + "shWeight:${data.vedioRules.corAl_VIDEO.rate} " +
"flWeight:${data.vedioRules.fL_VEDIO.rate} " + "flWeight:${data.vedioRules.fL_VEDIO.rate} " +
"rtaWeight:${data.vedioRules.rtA_VEDIO.rate} " +
"groMoreWeight:${data.vedioRules.gromorE_VEDIO.rate} "+ "groMoreWeight:${data.vedioRules.gromorE_VEDIO.rate} "+
"owWeight:${data.vedioRules.oW_VEDIO.rate} " +
"ksWeight:${data.vedioRules.kS_VEDIO.rate}" "ksWeight:${data.vedioRules.kS_VEDIO.rate}"
) )
// 广告视频数 // 广告视频数
...@@ -47,7 +47,7 @@ object UserWeight { ...@@ -47,7 +47,7 @@ object UserWeight {
AppConfig.flVideoAdCount = data.vedioRules.fL_VEDIO.surplus AppConfig.flVideoAdCount = data.vedioRules.fL_VEDIO.surplus
AppConfig.shVideoAdCount = data.vedioRules.corAl_VIDEO.surplus AppConfig.shVideoAdCount = data.vedioRules.corAl_VIDEO.surplus
AppConfig.ksVideoAdCount = data.vedioRules.kS_VEDIO.surplus AppConfig.ksVideoAdCount = data.vedioRules.kS_VEDIO.surplus
AppConfig.rtaVideoAdCount = data.vedioRules.rtA_VEDIO.surplus AppConfig.owVideoAdCount = data.vedioRules.oW_VEDIO.surplus
AppConfig.csjFullVideoAdCount = data.vedioRules.csjfulL_VEDIO.surplus AppConfig.csjFullVideoAdCount = data.vedioRules.csjfulL_VEDIO.surplus
AppConfig.groMoreVideoAdCount = data.vedioRules.gromorE_VEDIO.surplus AppConfig.groMoreVideoAdCount = data.vedioRules.gromorE_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " + LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " +
...@@ -56,8 +56,8 @@ object UserWeight { ...@@ -56,8 +56,8 @@ object UserWeight {
"csjFullCount:${AppConfig.csjFullVideoAdCount} " + "csjFullCount:${AppConfig.csjFullVideoAdCount} " +
"shCount:${AppConfig.shVideoAdCount} " + "shCount:${AppConfig.shVideoAdCount} " +
"flCount:${AppConfig.flVideoAdCount} " + "flCount:${AppConfig.flVideoAdCount} " +
"rtaCount:${AppConfig.rtaVideoAdCount} " +
"groMoreCount:${AppConfig.groMoreVideoAdCount} " + "groMoreCount:${AppConfig.groMoreVideoAdCount} " +
"owCount:${AppConfig.owVideoAdCount} " +
"ksCount:${AppConfig.ksVideoAdCount}" "ksCount:${AppConfig.ksVideoAdCount}"
) )
} }
......
...@@ -89,6 +89,7 @@ public class DrawcashBean implements Serializable { ...@@ -89,6 +89,7 @@ public class DrawcashBean implements Serializable {
private int KS_VEDIO; private int KS_VEDIO;
private int RTA_VEDIO; private int RTA_VEDIO;
private int GROMORE_VEDIO; private int GROMORE_VEDIO;
private int OW_VEDIO;
public int getRTA_VEDIO() { public int getRTA_VEDIO() {
return RTA_VEDIO; return RTA_VEDIO;
...@@ -129,6 +130,9 @@ public class DrawcashBean implements Serializable { ...@@ -129,6 +130,9 @@ public class DrawcashBean implements Serializable {
public int getGROMORE_VEDIO() { public int getGROMORE_VEDIO() {
return GROMORE_VEDIO; return GROMORE_VEDIO;
} }
public int getOW_VEDIO() {
return OW_VEDIO;
}
} }
public class CashOutMoneyArrBean implements Serializable { public class CashOutMoneyArrBean implements Serializable {
......
...@@ -13,6 +13,7 @@ public class VedioRulesBean implements Serializable { ...@@ -13,6 +13,7 @@ public class VedioRulesBean implements Serializable {
private KSVedioBean KS_VEDIO; private KSVedioBean KS_VEDIO;
private RTAVedioBean RTA_VEDIO; private RTAVedioBean RTA_VEDIO;
private GROMOREVedioBean GROMORE_VEDIO; private GROMOREVedioBean GROMORE_VEDIO;
private OWVedioBean OW_VEDIO;
private boolean flVideoFlag; private boolean flVideoFlag;
private boolean vedioSleep; private boolean vedioSleep;
...@@ -163,6 +164,22 @@ public class VedioRulesBean implements Serializable { ...@@ -163,6 +164,22 @@ public class VedioRulesBean implements Serializable {
public GROMOREVedioBean getGROMORE_VEDIO() { public GROMOREVedioBean getGROMORE_VEDIO() {
return GROMORE_VEDIO; return GROMORE_VEDIO;
} }
public OWVedioBean getOW_VEDIO() {
return OW_VEDIO;
}
public class OWVedioBean implements Serializable {
private int surplus;
private int rate;
public int getSurplus() {
return surplus;
}
public int getRate() {
return rate;
}
}
public void setRTA_VEDIO(RTAVedioBean RTA_VEDIO) { public void setRTA_VEDIO(RTAVedioBean RTA_VEDIO) {
this.RTA_VEDIO = RTA_VEDIO; this.RTA_VEDIO = RTA_VEDIO;
......
...@@ -306,8 +306,8 @@ class DrawcashActivity : BaseActivity(), ...@@ -306,8 +306,8 @@ class DrawcashActivity : BaseActivity(),
data.coraL_VEDIO, data.coraL_VEDIO,
data.csjfulL_VEDIO, data.csjfulL_VEDIO,
data.kS_VEDIO, data.kS_VEDIO,
data.rtA_VEDIO, data.gromorE_VEDIO,
data.gromorE_VEDIO data.oW_VEDIO
) )
LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} " + LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} " +
"ylhWeight:${data.ylH_VEDIO} " + "ylhWeight:${data.ylH_VEDIO} " +
...@@ -315,8 +315,8 @@ class DrawcashActivity : BaseActivity(), ...@@ -315,8 +315,8 @@ class DrawcashActivity : BaseActivity(),
"csjFullWeight:${data.csjfulL_VEDIO} " + "csjFullWeight:${data.csjfulL_VEDIO} " +
"shWeight:${data.coraL_VEDIO} " + "shWeight:${data.coraL_VEDIO} " +
"flWeight:${data.fL_VEDIO} " + "flWeight:${data.fL_VEDIO} " +
"rtaWeight:${data.rtA_VEDIO} " +
"groMoreWeight:${data.gromorE_VEDIO} " + "groMoreWeight:${data.gromorE_VEDIO} " +
"owWeight:${data.oW_VEDIO} " +
"ksWeight:${data.kS_VEDIO}" "ksWeight:${data.kS_VEDIO}"
) )
// 广告视频数 // 广告视频数
......
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