Commit a59bdf71 authored by mengcuiguang's avatar mengcuiguang

添加domob vedio

parent a57db8f6
...@@ -2,6 +2,7 @@ apply plugin: 'com.android.application' ...@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
//apply plugin: 'com.tendcloud.codelessplugin' //apply plugin: 'com.tendcloud.codelessplugin'
apply plugin: 'com.google.protobuf'
android { android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion compileSdkVersion rootProject.ext.androidCompileSdkVersion
...@@ -299,6 +300,9 @@ dependencies { ...@@ -299,6 +300,9 @@ dependencies {
implementation(name: 'shanhuAD-1.0.14', ext: 'aar') implementation(name: 'shanhuAD-1.0.14', ext: 'aar')
// 创神广告 // 创神广告
implementation(name: 'ad_support_library_v2.1.4', ext: 'aar') implementation(name: 'ad_support_library_v2.1.4', ext: 'aar')
// 多盟
implementation(name: 'domob_rvads_1.0.0', ext: 'aar')
implementation 'com.google.protobuf:protobuf-lite:3.0.0'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
......
...@@ -176,6 +176,11 @@ ...@@ -176,6 +176,11 @@
<data android:scheme="tencent1109991028" /> <data android:scheme="tencent1109991028" />
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 多盟 -->
<activity
android:name="com.dm.rvads.activity.DMPortraitADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" />
<activity <activity
android:name=".wxapi.WXEntryActivity" android:name=".wxapi.WXEntryActivity"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
......
package com.mints.highgold.ad package com.mints.highgold.ad
import android.app.Activity import android.app.Activity
import com.dm.rvads.common.util.AdError
import com.dm.rvads.rewardvideo.RewardVideoADListener
import com.dm.rvads.rewardvideo.RewardVideoAd
import com.mints.highgold.MintsApplication import com.mints.highgold.MintsApplication
import com.mints.highgold.mvp.views.ShanhuVedioAdManagerView import com.mints.highgold.common.Constant
import com.mints.highgold.manager.DomobManager
import com.mints.highgold.mvp.presenters.DomobVedioAdPresenter
import com.mints.highgold.mvp.views.DomobVedioAdView
import com.mints.highgold.utils.LogUtil
import java.util.*
/** /**
* 多盟视频 * 多盟视频
*/ */
class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioAdManagerView { class DomobVedioAdManager private constructor(activity: Activity) :
DomobVedioAdView, RewardVideoADListener {
private val TAG = DomobVedioAdManager::class.java.simpleName private val TAG = DomobVedioAdManager::class.java.simpleName
lateinit var rewardVideoAd: RewardVideoAd
lateinit var domobVedioAdPresenter: DomobVedioAdPresenter
private var domobVedioAdListener: DomobVedioAdListener? = null private var domobVedioAdListener: DomobVedioAdListener? = null
var activity: Activity? = null var activity: Activity? = null
...@@ -19,6 +31,8 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA ...@@ -19,6 +31,8 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA
private var downloadCoin = 10 private var downloadCoin = 10
private var carrierType = "" private var carrierType = ""
private var isClickScreen: Boolean = true
companion object { companion object {
private var _inst: DomobVedioAdManager? = null private var _inst: DomobVedioAdManager? = null
fun getInstance(activity: Activity): DomobVedioAdManager? { fun getInstance(activity: Activity): DomobVedioAdManager? {
...@@ -37,14 +51,85 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA ...@@ -37,14 +51,85 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA
private fun init(activity: Activity) { private fun init(activity: Activity) {
this.activity = activity this.activity = activity
domobVedioAdPresenter = DomobVedioAdPresenter()
domobVedioAdPresenter.attachView(this)
} }
fun loadDomobAd(downloadCoin: Int, curCoin: Int, carrierType: String, extraId: String?) { fun loadDomobAd(downloadCoin: Int, curCoin: Int, carrierType: String, extraId: String?) {
if (activity == null) {
return
}
isClickScreen = true
this.downloadCoin = downloadCoin this.downloadCoin = downloadCoin
this.carrierType = carrierType this.carrierType = carrierType
this.curCoin = curCoin this.curCoin = curCoin
this.extraId = extraId this.extraId = extraId
var postId: String
when (carrierType) {
Constant.CARRIER_DAILY_VIDEO -> postId = DomobManager.DOMOB_AD_VEDIO_MAIN_LOOK
Constant.CARRIER_VERSUS_VIDEO -> postId = DomobManager.DOMOB_AD_VEDIO_VERSUS_LOOK
Constant.CARRIER_ONLINE_INCOME_DOUBLE, Constant.CARRIER_HOMEWATER_BUBBLE -> postId = DomobManager.DOMOB_AD_VEDIO_MAIN_POP
Constant.CARRIER_REDENVELOPE_DOUBLE, Constant.CARRIER_REDENVELOPE -> postId = DomobManager.DOMOB_AD_VEDIO_REDBOX
else -> postId = DomobManager.DOMOB_AD_VEDIO_MAIN_LOOK
}
rewardVideoAd = RewardVideoAd(activity, DomobManager.DOMOB_AD_APPID, postId, this)
rewardVideoAd.loadAD()
}
override fun onADClick() {
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_DUOMENT, Constant.EVENT_TYPE_TWO, "", "")
//
// if (isClickScreen) {
// // 防止重复
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_DUOMENT, Constant.EVENT_TYPE_FOUR, "", "")
// isClickScreen = false
// }
if (domobVedioAdListener != null) {
domobVedioAdListener?.domobVedioAdDownload()
}
}
override fun onVideoCached() {
rewardVideoAd.showAd()
LogUtil.d(TAG, "onVideoCached")
}
override fun onReward() {
LogUtil.d(TAG, "onReward")
}
override fun onADClose() {
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_DUOMENT, Constant.EVENT_TYPE_THREE, "", "")
if (domobVedioAdListener != null) {
domobVedioAdListener?.domobVedioAdSuccess()
}
// domobVedioAdPresenter?.reportAddCoinMsg(activity, getAdMapVO())
LogUtil.d(TAG, "onADClose")
}
override fun onVideoComplete() {
LogUtil.d(TAG, "onVideoComplete")
}
override fun onError(error: AdError?) {
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CHUANGSHEN, Constant.EVENT_TYPE_ONE, (error?.errorCode).toString(), error?.errorMsg)
if (domobVedioAdListener != null) {
domobVedioAdListener?.domobVedioAdFail()
}
LogUtil.d(TAG, "onError code:${error?.errorCode} msg:${error?.errorMsg}")
}
override fun onADShow() {
LogUtil.d(TAG, "onADShow")
// TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_DUOMENT, Constant.EVENT_TYPE_ZERO, "", "")
} }
fun setDomobVedioAdListener(domobVedioAdListener: DomobVedioAdListener?) { fun setDomobVedioAdListener(domobVedioAdListener: DomobVedioAdListener?) {
...@@ -70,4 +155,79 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA ...@@ -70,4 +155,79 @@ class DomobVedioAdManager private constructor(activity: Activity) : ShanhuVedioA
} }
override fun getBaseApplication() = activity?.application as MintsApplication override fun getBaseApplication() = activity?.application as MintsApplication
private fun getAdMapVO(): HashMap<String, Any> {
val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType
vo["adtype"] = Constant.ADTYPE_VEDIO
vo["adsource"] = Constant.AD_SOURCE_DOMOB
when (carrierType) {
Constant.CARRIER_VERSUS_VIDEO -> vo["coin"] = curCoin
Constant.CARRIER_DAILY_DOWNLOAD -> vo["coin"] = curCoin
Constant.CARRIER_DAILY_VIDEO -> vo["coin"] = curCoin
Constant.CARRIER_HOMEWATER_BUBBLE -> vo["waterCoin"] = curCoin
Constant.CARRIER_ONLINE_INCOME_DOUBLE -> vo["online_income"] = curCoin
Constant.CARRIER_OFFLINE_DOUBLE -> {
vo["offline_income"] = curCoin
vo["page"] = Constant.PAGE_TWO
vo["block"] = Constant.BLOCK_ONE
vo["order"] = Constant.ORDER_ONE
}
Constant.CARRIER_SIGNIN_HOMEPAGE_CARD -> {
vo["page"] = Constant.PAGE_TWO
vo["block"] = Constant.BLOCK_ONE
vo["order"] = Constant.ORDER_ONE
}
Constant.CARRIER_DRINK, Constant.CARRIER_DRINK_PATCH -> {
vo["page"] = Constant.PAGE_ONE
vo["block"] = Constant.BLOCK_FOUR
vo["order"] = Constant.ORDER_ONE
vo["critId"] = extraId!!
}
Constant.CARRIER_VERSUS_DRINKTEA -> {
vo["page"] = Constant.PAGE_TWO
vo["block"] = Constant.BLOCK_ONE
vo["order"] = Constant.ORDER_THREE
vo["critId"] = extraId!!
}
Constant.CARRIER_DAILY_TURN -> {
vo["page"] = Constant.PAGE_ONE
vo["block"] = Constant.BLOCK_THREE
vo["order"] = Constant.ORDER_THREE
vo["turntableKey"] = extraId!!
}
Constant.CARRIER_CHALLENGE_TURN -> {
vo["page"] = Constant.PAGE_TWO
vo["block"] = Constant.BLOCK_ONE
vo["order"] = Constant.ORDER_FOUR
vo["turntableKey"] = extraId!!
}
Constant.CARRIER_CHALLENGE_CARD -> {
vo["page"] = Constant.PAGE_TWO
vo["block"] = Constant.BLOCK_ONE
vo["order"] = Constant.ORDER_FIVE
vo["turntableKey"] = extraId!!
}
Constant.CARRIER_REDENVELOPE_DOUBLE, Constant.CARRIER_REDENVELOPE -> {
vo["page"] = Constant.PAGE_ONE
vo["block"] = Constant.BLOCK_ONE
vo["order"] = Constant.ORDER_ONE
vo["numKey"] = extraId!!
}
else -> {
vo["page"] = Constant.PAGE_ONE
if (curCoin != -1) {
vo["online_income"] = curCoin
}
}
}
return vo
}
fun destory() {
domobVedioAdPresenter?.let {
domobVedioAdPresenter.dispose()
domobVedioAdPresenter.detachView()
}
}
} }
\ No newline at end of file
...@@ -33,16 +33,6 @@ public class AppConfig { ...@@ -33,16 +33,6 @@ public class AppConfig {
*/ */
public static boolean mainWaterviewStatus = false; public static boolean mainWaterviewStatus = false;
/**
* 上一个播放的广告类型
*/
public static String preAdType = "";
/**
* 上一个播放的广告时间
*/
public static long preAdTime = 0;
/** /**
* ylh 剩余广告播放数 * ylh 剩余广告播放数
*/ */
......
...@@ -193,7 +193,7 @@ public interface Constant { ...@@ -193,7 +193,7 @@ public interface Constant {
String AD_SOURCE_HYTECH = "HYTECH";//东方网 String AD_SOURCE_HYTECH = "HYTECH";//东方网
String AD_SOURCE_SHANHU = "CORAL";//珊瑚 String AD_SOURCE_SHANHU = "CORAL";//珊瑚
String AD_SOURCE_CHUANGSHEN = "CHUANGSHEN";//创神 String AD_SOURCE_CHUANGSHEN = "CHUANGSHEN";//创神
String AD_SOURCE_DUOMENT = "DUOMENT";//多盟 String AD_SOURCE_DOMOB = "DOMOB";//多盟
// 页面 // 页面
int PAGE_ONE = 1; int PAGE_ONE = 1;
......
package com.mints.highgold.manager
/**
* 多盟
*/
object DomobManager {
const val DOMOB_AD_APPID = "96AgVZwg0XNR8oOBqU"
const val DOMOB_AD_VEDIO_MAIN_LOOK = "A0104601332"//首页看视频
const val DOMOB_AD_VEDIO_REDBOX = "A0204601331"//抢红包
const val DOMOB_AD_VEDIO_VERSUS_LOOK = "A0304601330"//任务赚看视频
const val DOMOB_AD_VEDIO_MAIN_POP = "A1104601329"//汽泡
}
\ No newline at end of file
...@@ -74,6 +74,7 @@ public class UserTaskMsgBean implements Serializable { ...@@ -74,6 +74,7 @@ public class UserTaskMsgBean implements Serializable {
private int vedioplan_mintegral_vedio_rate; private int vedioplan_mintegral_vedio_rate;
private int vedioplan_coral_vedio_rate; private int vedioplan_coral_vedio_rate;
private int vedioplan_chuangshen_vedio_rate; private int vedioplan_chuangshen_vedio_rate;
private int vedioplan_domob_vedio_rate;
private int vedioplan_csj_vedio_surplus; private int vedioplan_csj_vedio_surplus;
private int vedioplan_liyan_vedio_surplus; private int vedioplan_liyan_vedio_surplus;
...@@ -83,6 +84,7 @@ public class UserTaskMsgBean implements Serializable { ...@@ -83,6 +84,7 @@ public class UserTaskMsgBean implements Serializable {
private int vedioplan_mintegral_vedio_surplus; private int vedioplan_mintegral_vedio_surplus;
private int vedioplan_coral_vedio_surplus; private int vedioplan_coral_vedio_surplus;
private int vedioplan_chuangshen_vedio_surplus; private int vedioplan_chuangshen_vedio_surplus;
private int vedioplan_domob_vedio_surplus;
public int getVedioplan_hytech_vedio_rate() { public int getVedioplan_hytech_vedio_rate() {
return vedioplan_hytech_vedio_rate; return vedioplan_hytech_vedio_rate;
...@@ -428,4 +430,20 @@ public class UserTaskMsgBean implements Serializable { ...@@ -428,4 +430,20 @@ public class UserTaskMsgBean implements Serializable {
public void setVedioplan_chuangshen_vedio_surplus(int vedioplan_chuangshen_vedio_surplus) { public void setVedioplan_chuangshen_vedio_surplus(int vedioplan_chuangshen_vedio_surplus) {
this.vedioplan_chuangshen_vedio_surplus = vedioplan_chuangshen_vedio_surplus; this.vedioplan_chuangshen_vedio_surplus = vedioplan_chuangshen_vedio_surplus;
} }
public int getVedioplan_domob_vedio_rate() {
return vedioplan_domob_vedio_rate;
}
public void setVedioplan_domob_vedio_rate(int vedioplan_domob_vedio_rate) {
this.vedioplan_domob_vedio_rate = vedioplan_domob_vedio_rate;
}
public int getVedioplan_domob_vedio_surplus() {
return vedioplan_domob_vedio_surplus;
}
public void setVedioplan_domob_vedio_surplus(int vedioplan_domob_vedio_surplus) {
this.vedioplan_domob_vedio_surplus = vedioplan_domob_vedio_surplus;
}
} }
package com.mints.highgold.mvp.presenters
import android.app.Activity
import com.mints.highgold.MintsApplication
import com.mints.highgold.mvp.model.BaseResponse
import com.mints.highgold.mvp.views.DomobVedioAdView
import com.mints.highgold.net.LoanService
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import rx.Subscription
import rx.android.schedulers.AndroidSchedulers
import java.util.*
class DomobVedioAdPresenter : BasePresenter<DomobVedioAdView>() {
fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) {
if (activity == null) return
loanApplication = activity.application as MintsApplication
loanService = loanApplication.getLoanService()
subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(loanApplication.defaultSubscribeScheduler())
.subscribe(object : BaseSubscriber<BaseResponse<Any?>?>() {
override fun onCompleted() {}
override fun onError(e: Throwable) {
}
fun onNext(baseResponse: BaseResponse<Any?>) {}
})
}
fun dispose() {
loanService = null
loanApplication = null
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe()
}
}
}
\ No newline at end of file
package com.mints.highgold.mvp.views
interface DomobVedioAdView : BaseView {
}
\ No newline at end of file
...@@ -794,8 +794,6 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -794,8 +794,6 @@ public class AwardActivity extends BaseActivity implements AwardView {
//广告展示检查3:展示广告前判断广告数据未过期 //广告展示检查3:展示广告前判断广告数据未过期
if (SystemClock.elapsedRealtime() < (rewardVideoAD.getExpireTimestamp() - delta)) { if (SystemClock.elapsedRealtime() < (rewardVideoAD.getExpireTimestamp() - delta)) {
AppConfig.ylhAdCount--; AppConfig.ylhAdCount--;
AppConfig.preAdType = Constant.YLH_VEDIO_AD;
AppConfig.preAdTime = Calendar.getInstance().getTimeInMillis();
rewardVideoAD.showAD(); rewardVideoAD.showAD();
} else { } else {
...@@ -985,8 +983,6 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -985,8 +983,6 @@ public class AwardActivity extends BaseActivity implements AwardView {
@Override @Override
public void onAdShow() {//视频广告展示回调 public void onAdShow() {//视频广告展示回调
AppConfig.csjVedioAdCount--; AppConfig.csjVedioAdCount--;
AppConfig.preAdType = Constant.CSJ_VEDIO_AD;
AppConfig.preAdTime = Calendar.getInstance().getTimeInMillis();
isloadTTVedio = true; isloadTTVedio = true;
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CSJ, Constant.EVENT_TYPE_ZERO, "", ""); TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_CSJ, Constant.EVENT_TYPE_ZERO, "", "");
...@@ -1113,8 +1109,6 @@ public class AwardActivity extends BaseActivity implements AwardView { ...@@ -1113,8 +1109,6 @@ public class AwardActivity extends BaseActivity implements AwardView {
hideLoading(); hideLoading();
AppConfig.csjFullAdCount--; AppConfig.csjFullAdCount--;
AppConfig.preAdType = Constant.CSJ_FULL_AD;
AppConfig.preAdTime = Calendar.getInstance().getTimeInMillis();
} }
@Override @Override
......
...@@ -26,6 +26,7 @@ import com.google.gson.JsonObject; ...@@ -26,6 +26,7 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import com.mints.highgold.BuildConfig; import com.mints.highgold.BuildConfig;
import com.mints.highgold.R; import com.mints.highgold.R;
import com.mints.highgold.ad.DomobVedioAdManager;
import com.mints.highgold.ad.VedioAdingManager; import com.mints.highgold.ad.VedioAdingManager;
import com.mints.highgold.ad.inscreenvedio.MintegralInscreenVedioAdManager; import com.mints.highgold.ad.inscreenvedio.MintegralInscreenVedioAdManager;
import com.mints.highgold.common.AppConfig; import com.mints.highgold.common.AppConfig;
...@@ -356,9 +357,7 @@ public class MainFragment extends BaseFragment ...@@ -356,9 +357,7 @@ public class MainFragment extends BaseFragment
Bundle bundle; Bundle bundle;
switch (view.getId()) { switch (view.getId()) {
case R.id.tv_fragment_main_whatgold:// 如何赚金币 case R.id.tv_fragment_main_whatgold:// 如何赚金币
// readyGo(ReadActivity.class);
readyGo(WhatGoldActivity.class); readyGo(WhatGoldActivity.class);
// DomobVedioAdManager.Companion.getInstance(getActivity()).loadDomobAd(10,20,"main","abc");
break; break;
case R.id.rl_fragment_main_redbox:// 红包 case R.id.rl_fragment_main_redbox:// 红包
readyGo(RedboxActivity.class); readyGo(RedboxActivity.class);
...@@ -475,27 +474,34 @@ public class MainFragment extends BaseFragment ...@@ -475,27 +474,34 @@ public class MainFragment extends BaseFragment
//测试数据 //测试数据
// data.setVedioplan_csj_vedio_rate(0); data.setVedioplan_csj_vedio_rate(0);
// data.setVedioplan_lyh_vedio_rate(0); data.setVedioplan_lyh_vedio_rate(0);
// data.setVedioplan_csj_full_screen_video_rate(0); data.setVedioplan_csj_full_screen_video_rate(0);
// data.setVedioplan_hytech_vedio_rate(0); data.setVedioplan_hytech_vedio_rate(0);
// data.setVedioplan_mintegral_vedio_rate(0); data.setVedioplan_mintegral_vedio_rate(0);
// data.setVedioplan_coral_vedio_rate(0); data.setVedioplan_coral_vedio_rate(0);
// data.setVedioplan_chuangshen_vedio_rate(10); data.setVedioplan_domob_vedio_rate(10);
// data.setVedioplan_chuangshen_vedio_rate(0);
// data.setVedioplan_csj_vedio_surplus(0);
// data.setVedioplan_lyh_vedio_surplus(0); data.setVedioplan_csj_vedio_surplus(0);
// data.setVedioplan_csj_full_screen_video_surplus(0); data.setVedioplan_lyh_vedio_surplus(0);
// data.setVedioplan_hytech_vedio_surplus(0); data.setVedioplan_csj_full_screen_video_surplus(0);
// data.setVedioplan_mintegral_vedio_surplus(0); data.setVedioplan_hytech_vedio_surplus(0);
// data.setVedioplan_coral_vedio_surplus(0); data.setVedioplan_mintegral_vedio_surplus(0);
// data.setVedioplan_chuangshen_vedio_surplus(10); data.setVedioplan_coral_vedio_surplus(0);
data.setVedioplan_domob_vedio_surplus(10);
data.setVedioplan_chuangshen_vedio_surplus(0);
// 设置随机广告权重 // 设置随机广告权重
if (vedioAdingManager != null) { if (vedioAdingManager != null) {
vedioAdingManager.initAdWeight(data.getVedioplan_csj_vedio_rate(), data.getVedioplan_lyh_vedio_rate(), data.getVedioplan_csj_full_screen_video_rate(), data.getVedioplan_hytech_vedio_rate(), data.getVedioplan_mintegral_vedio_rate(), data.getVedioplan_coral_vedio_rate(), data.getVedioplan_chuangshen_vedio_rate()); vedioAdingManager.initAdWeight(data.getVedioplan_csj_vedio_rate(), data.getVedioplan_lyh_vedio_rate(),
data.getVedioplan_csj_full_screen_video_rate(), data.getVedioplan_hytech_vedio_rate(),
data.getVedioplan_mintegral_vedio_rate(), data.getVedioplan_coral_vedio_rate(),
data.getVedioplan_chuangshen_vedio_rate(),data.getVedioplan_domob_vedio_rate());
} }
LogUtil.d(TAG, "首页权重值:csjVedioWeight:" + data.getVedioplan_csj_vedio_rate() + " ylhWeight:" + data.getVedioplan_lyh_vedio_rate() + " csjFullWeight:" + data.getVedioplan_csj_full_screen_video_rate() + " hytechVedioAdWeight:" + data.getVedioplan_hytech_vedio_rate() + " mintegralVedioAdWeight:" + data.getVedioplan_mintegral_vedio_rate() + " shanhuVedioAdWeight:" + data.getVedioplan_coral_vedio_rate()+ " chuangshenVedioAdWeight:" + data.getVedioplan_chuangshen_vedio_rate()); LogUtil.d(TAG, "首页权重值:csjVedioWeight:" + data.getVedioplan_csj_vedio_rate() + " ylhWeight:" + data.getVedioplan_lyh_vedio_rate() + " csjFullWeight:" + data.getVedioplan_csj_full_screen_video_rate() +
" hytechVedioAdWeight:" + data.getVedioplan_hytech_vedio_rate() + " mintegralVedioAdWeight:" + data.getVedioplan_mintegral_vedio_rate() + " shanhuVedioAdWeight:" + data.getVedioplan_coral_vedio_rate()+
" chuangshenVedioAdWeight:" + data.getVedioplan_chuangshen_vedio_rate()+" domobVedioAdWeight:" + data.getVedioplan_domob_vedio_rate());
// 广告视频数 // 广告视频数
AppConfig.csjVedioAdCount = data.getVedioplan_csj_vedio_surplus(); AppConfig.csjVedioAdCount = data.getVedioplan_csj_vedio_surplus();
AppConfig.ylhAdCount = data.getVedioplan_lyh_vedio_surplus(); AppConfig.ylhAdCount = data.getVedioplan_lyh_vedio_surplus();
...@@ -504,7 +510,11 @@ public class MainFragment extends BaseFragment ...@@ -504,7 +510,11 @@ public class MainFragment extends BaseFragment
AppConfig.mintegralAdCount = data.getVedioplan_mintegral_vedio_surplus(); AppConfig.mintegralAdCount = data.getVedioplan_mintegral_vedio_surplus();
AppConfig.shanhuAdCount = data.getVedioplan_coral_vedio_surplus(); AppConfig.shanhuAdCount = data.getVedioplan_coral_vedio_surplus();
AppConfig.chuangshenVedioAdCount = data.getVedioplan_chuangshen_vedio_surplus(); AppConfig.chuangshenVedioAdCount = data.getVedioplan_chuangshen_vedio_surplus();
LogUtil.d(TAG, "首页视频数:csjVedioAdCount:" + data.getVedioplan_csj_vedio_surplus() + " ylhAdCount:" + data.getVedioplan_lyh_vedio_surplus() + " csjFullAdCount:" + data.getVedioplan_csj_full_screen_video_surplus() + " hytechVedioAdCount:" + data.getVedioplan_hytech_vedio_surplus() + " mintegralVedioAdCount:" + data.getVedioplan_mintegral_vedio_surplus() + " shanhuVedioAdCount:" + data.getVedioplan_coral_vedio_surplus()+ " chuangshenVedioAdCount:" + data.getVedioplan_chuangshen_vedio_surplus()); AppConfig.duomentVedioAdCount = data.getVedioplan_domob_vedio_surplus();
LogUtil.d(TAG, "首页视频数:csjVedioAdCount:" + data.getVedioplan_csj_vedio_surplus() + " ylhAdCount:" + data.getVedioplan_lyh_vedio_surplus() + " csjFullAdCount:" + data.getVedioplan_csj_full_screen_video_surplus() +
" hytechVedioAdCount:" + data.getVedioplan_hytech_vedio_surplus() + " mintegralVedioAdCount:" + data.getVedioplan_mintegral_vedio_surplus() + " shanhuVedioAdCount:" + data.getVedioplan_coral_vedio_surplus()+
" chuangshenVedioAdCount:" + data.getVedioplan_chuangshen_vedio_surplus()+" domobVedioAdCount:" + data.getVedioplan_domob_vedio_surplus());
AppConfig.yilanVedioTime = data.getRedPacketSecond(); AppConfig.yilanVedioTime = data.getRedPacketSecond();
userManager.setAdShowFlag(data.isAdFlag()); userManager.setAdShowFlag(data.isAdFlag());
...@@ -1434,7 +1444,8 @@ public class MainFragment extends BaseFragment ...@@ -1434,7 +1444,8 @@ public class MainFragment extends BaseFragment
TextUtils.equals(adType, Constant.CSJ_VEDIO_AD) || TextUtils.equals(adType, Constant.CSJ_VEDIO_AD) ||
TextUtils.equals(adType, Constant.CSJ_FULL_AD) || TextUtils.equals(adType, Constant.CSJ_FULL_AD) ||
TextUtils.equals(adType, Constant.SHANHU_VEDIO_AD) || TextUtils.equals(adType, Constant.SHANHU_VEDIO_AD) ||
TextUtils.equals(adType, Constant.MINTEGRAL_VEDIO_AD)) { TextUtils.equals(adType, Constant.MINTEGRAL_VEDIO_AD)||
TextUtils.equals(adType, Constant.DUOMENT_VEDIO_AD)) {
if (TextUtils.equals(adType, Constant.YLH_VEDIO_AD)) { if (TextUtils.equals(adType, Constant.YLH_VEDIO_AD)) {
AD_SOURCE = Constant.AD_SOURCE_YLH; AD_SOURCE = Constant.AD_SOURCE_YLH;
...@@ -1442,6 +1453,8 @@ public class MainFragment extends BaseFragment ...@@ -1442,6 +1453,8 @@ public class MainFragment extends BaseFragment
AD_SOURCE = Constant.AD_SOURCE_MINTEGRAL; AD_SOURCE = Constant.AD_SOURCE_MINTEGRAL;
} else if (TextUtils.equals(adType, Constant.SHANHU_VEDIO_AD)) { } else if (TextUtils.equals(adType, Constant.SHANHU_VEDIO_AD)) {
AD_SOURCE = Constant.AD_SOURCE_SHANHU; AD_SOURCE = Constant.AD_SOURCE_SHANHU;
} else if (TextUtils.equals(adType, Constant.DUOMENT_VEDIO_AD)) {
AD_SOURCE = Constant.AD_SOURCE_SHANHU;
} else { } else {
AD_SOURCE = Constant.AD_SOURCE_CSJ; AD_SOURCE = Constant.AD_SOURCE_CSJ;
} }
......
...@@ -2243,7 +2243,8 @@ public class VersusFragment extends BaseFragment ...@@ -2243,7 +2243,8 @@ public class VersusFragment extends BaseFragment
TextUtils.equals(adType, Constant.CSJ_VEDIO_AD) || TextUtils.equals(adType, Constant.CSJ_VEDIO_AD) ||
TextUtils.equals(adType, Constant.CSJ_FULL_AD) || TextUtils.equals(adType, Constant.CSJ_FULL_AD) ||
TextUtils.equals(adType, Constant.SHANHU_VEDIO_AD) || TextUtils.equals(adType, Constant.SHANHU_VEDIO_AD) ||
TextUtils.equals(adType, Constant.MINTEGRAL_VEDIO_AD)) { TextUtils.equals(adType, Constant.MINTEGRAL_VEDIO_AD) ||
TextUtils.equals(adType, Constant.DUOMENT_VEDIO_AD)) {
if (TextUtils.equals(adType, Constant.YLH_VEDIO_AD)) { if (TextUtils.equals(adType, Constant.YLH_VEDIO_AD)) {
AD_SOURCE = Constant.AD_SOURCE_YLH; AD_SOURCE = Constant.AD_SOURCE_YLH;
...@@ -2251,6 +2252,8 @@ public class VersusFragment extends BaseFragment ...@@ -2251,6 +2252,8 @@ public class VersusFragment extends BaseFragment
AD_SOURCE = Constant.AD_SOURCE_MINTEGRAL; AD_SOURCE = Constant.AD_SOURCE_MINTEGRAL;
} else if (TextUtils.equals(adType, Constant.SHANHU_VEDIO_AD)) { } else if (TextUtils.equals(adType, Constant.SHANHU_VEDIO_AD)) {
AD_SOURCE = Constant.AD_SOURCE_SHANHU; AD_SOURCE = Constant.AD_SOURCE_SHANHU;
} else if (TextUtils.equals(adType, Constant.DUOMENT_VEDIO_AD)) {
AD_SOURCE = Constant.AD_SOURCE_DOMOB;
} else { } else {
AD_SOURCE = Constant.AD_SOURCE_CSJ; AD_SOURCE = Constant.AD_SOURCE_CSJ;
} }
......
...@@ -18,6 +18,9 @@ buildscript { ...@@ -18,6 +18,9 @@ buildscript {
// maven { url 'https://raw.githubusercontent.com/TalkingData/SDKMaven/master/' } // maven { url 'https://raw.githubusercontent.com/TalkingData/SDKMaven/master/' }
} }
dependencies { dependencies {
// domob广告
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
classpath 'com.android.tools.build:gradle:3.5.1' classpath 'com.android.tools.build:gradle:3.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// TalkingDada 灵动事件 // TalkingDada 灵动事件
......
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