Commit b4a361eb authored by mengcuiguang's avatar mengcuiguang

添加新插屏代码位及权重

parent 87a86926
...@@ -43,8 +43,6 @@ public class FullGroManager { ...@@ -43,8 +43,6 @@ public class FullGroManager {
private String fullId; private String fullId;
private ArrayList<WeightBean> weightList; private ArrayList<WeightBean> weightList;
private int fullInterstitialWeight = 99;
private int interstitialWeight = 1;
public void loadFullAd(Activity activity, boolean isMain) { public void loadFullAd(Activity activity, boolean isMain) {
// 加载到广告且未展示 则返回 // 加载到广告且未展示 则返回
...@@ -157,7 +155,7 @@ public class FullGroManager { ...@@ -157,7 +155,7 @@ public class FullGroManager {
break; break;
} }
LogUtil.d("id:"+id); LogUtil.d("id:" + id);
return id; return id;
} }
...@@ -169,10 +167,16 @@ public class FullGroManager { ...@@ -169,10 +167,16 @@ public class FullGroManager {
} }
int weight = 0; int weight = 0;
int fullInterstitialWeight = CsjGroMoreManager.INSTANCE.getAPP_FULL_NEW_INTERSTITIAL_WEIGHT();
if (fullInterstitialWeight > 0) {
weightList.add(new WeightBean(fullInterstitialWeight, Constant.GROMORE_NEW_FULL_AD)); weightList.add(new WeightBean(fullInterstitialWeight, Constant.GROMORE_NEW_FULL_AD));
weight = weight + fullInterstitialWeight; weight = weight + fullInterstitialWeight;
}
int interstitialWeight = CsjGroMoreManager.INSTANCE.getAPP_NEW_INTERSTITIAL_WEIGHT();
if (interstitialWeight > 0) {
weightList.add(new WeightBean(interstitialWeight, Constant.GROMORE_NEW_INSERTSCREEN_AD)); weightList.add(new WeightBean(interstitialWeight, Constant.GROMORE_NEW_INSERTSCREEN_AD));
weight = weight + interstitialWeight; weight = weight + interstitialWeight;
}
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);
...@@ -188,7 +192,7 @@ public class FullGroManager { ...@@ -188,7 +192,7 @@ public class FullGroManager {
} }
} }
} }
return ""; return Constant.GROMORE_NEW_FULL_AD;
} }
public void showFullAd() { public void showFullAd() {
......
package com.mints.flowbox.manager package com.mints.flowbox.manager
import android.text.TextUtils
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.manager.ad.TTGroMoreAdManagerHolder import com.mints.flowbox.manager.ad.TTGroMoreAdManagerHolder
import com.mints.flowbox.mvp.model.GroAdcodeBean import com.mints.flowbox.mvp.model.GroAdcodeBean
...@@ -14,6 +15,7 @@ object CsjGroMoreManager { ...@@ -14,6 +15,7 @@ object CsjGroMoreManager {
* 应用内: * 应用内:
* 普通: * 普通:
* 新插屏(全屏) -> 946333578 * 新插屏(全屏) -> 946333578
* 新插屏(插屏) ->
* 信息流 -> 946265897 * 信息流 -> 946265897
* 网赚: * 网赚:
* 激励视频 -> 946265896 * 激励视频 -> 946265896
...@@ -23,6 +25,7 @@ object CsjGroMoreManager { ...@@ -23,6 +25,7 @@ object CsjGroMoreManager {
* 应用外: * 应用外:
* 普通: * 普通:
* 新插屏(全屏) -> 946333773 * 新插屏(全屏) -> 946333773
* 新插屏(插屏) ->
* 信息流 -> 946333992 * 信息流 -> 946333992
* 锁屏: * 锁屏:
* 信息流 -> 946334023 * 信息流 -> 946334023
...@@ -41,6 +44,9 @@ object CsjGroMoreManager { ...@@ -41,6 +44,9 @@ object CsjGroMoreManager {
var APP_IN_MAIN_AD_UNIT_INTERSTITIAL_ID = "946334151" // 应用内 网赚 插屏 var APP_IN_MAIN_AD_UNIT_INTERSTITIAL_ID = "946334151" // 应用内 网赚 插屏
var APP_IN_MAIN_AD_UNIT_SPLASH_ID = "887506685" // 应用内 网赚 开屏 var APP_IN_MAIN_AD_UNIT_SPLASH_ID = "887506685" // 应用内 网赚 开屏
var APP_FULL_NEW_INTERSTITIAL_WEIGHT = 2 // 新插屏(全屏)权重
var APP_NEW_INTERSTITIAL_WEIGHT = 1 // 新插屏(插屏)权重
fun init(application: MintsApplication) { fun init(application: MintsApplication) {
TTGroMoreAdManagerHolder.init(application) TTGroMoreAdManagerHolder.init(application)
} }
...@@ -50,28 +56,49 @@ object CsjGroMoreManager { ...@@ -50,28 +56,49 @@ object CsjGroMoreManager {
*/ */
fun updataIdByChannel(idBean: GroAdcodeBean?) { fun updataIdByChannel(idBean: GroAdcodeBean?) {
// 渠道对象不为空 // 渠道对象不为空
if (idBean != null) { idBean?.let {
if (idBean.gromoreAdcodes_main != null) { // 应用内网赚 if (it.gromoreAdcodes_main != null) { // 应用内网赚
APP_IN_MAIN_AD_UNIT_EXPRESS_ID = idBean.gromoreAdcodes_main.groExpress if (!TextUtils.isEmpty(it.gromoreAdcodes_main.groExpress)) {
APP_IN_MAIN_AD_UNIT_VIDEO_ID = idBean.gromoreAdcodes_main.groVideo APP_IN_MAIN_AD_UNIT_EXPRESS_ID = it.gromoreAdcodes_main.groExpress
APP_IN_MAIN_AD_UNIT_INTERSTITIAL_ID = idBean.gromoreAdcodes_main.groInterstitial }
APP_IN_MAIN_AD_UNIT_SPLASH_ID = idBean.gromoreAdcodes_main.groSplash if (!TextUtils.isEmpty(it.gromoreAdcodes_main.groVideo)) {
APP_IN_MAIN_AD_UNIT_VIDEO_ID = it.gromoreAdcodes_main.groVideo
}
if (!TextUtils.isEmpty(it.gromoreAdcodes_main.groInterstitial)) {
APP_IN_MAIN_AD_UNIT_INTERSTITIAL_ID = it.gromoreAdcodes_main.groInterstitial
}
if (!TextUtils.isEmpty(it.gromoreAdcodes_main.groSplash)) {
APP_IN_MAIN_AD_UNIT_SPLASH_ID = it.gromoreAdcodes_main.groSplash
}
}
if (it.gromoreAdcodes_ordinary != null) { // 应用内普通
if (!TextUtils.isEmpty(it.gromoreAdcodes_ordinary.groExpress)) {
APP_IN_COMMON_AD_UNIT_EXPRESS_ID = it.gromoreAdcodes_ordinary.groExpress
}
if (!TextUtils.isEmpty(it.gromoreAdcodes_ordinary.groNewInterstitial)) {
APP_IN_COMMON_AD_FULL_UNIT_NEW_INTERSTITIAL_ID = it.gromoreAdcodes_ordinary.groNewInterstitial
}
} }
if (idBean.gromoreAdcodes_ordinary != null) { // 应用内普通 if (it.gromoreAdcodes_outer_lock != null) { // 应用外锁屏
APP_IN_COMMON_AD_UNIT_EXPRESS_ID = idBean.gromoreAdcodes_ordinary.groExpress if (!TextUtils.isEmpty(it.gromoreAdcodes_outer_lock.groExpress)) {
APP_IN_COMMON_AD_FULL_UNIT_NEW_INTERSTITIAL_ID = APP_OUT_AD_UNIT_LOCK_EXPRESS_ID = it.gromoreAdcodes_outer_lock.groExpress
idBean.gromoreAdcodes_ordinary.groNewInterstitial }
} }
if (idBean.gromoreAdcodes_outer_lock != null) { // 应用外锁屏 if (it.gromoreAdcodes_outer_ordinary != null) { // 应用外普通
APP_OUT_AD_UNIT_LOCK_EXPRESS_ID = idBean.gromoreAdcodes_outer_lock.groExpress if (!TextUtils.isEmpty(it.gromoreAdcodes_main.groExpress)) {
APP_OUT_AD_UNIT_EXPRESS_ID = it.gromoreAdcodes_main.groExpress
}
if (!TextUtils.isEmpty(it.gromoreAdcodes_outer_ordinary.groNewInterstitial)) {
APP_OUT_AD_UNIT_FULL_NEW_INTERSTITIAL_ID = it.gromoreAdcodes_outer_ordinary.groNewInterstitial
}
} }
if (idBean.gromoreAdcodes_outer_ordinary != null) { // 应用外普通 if (it.newnIterstitialHalfRate != null) {// 新插屏权重
APP_OUT_AD_UNIT_EXPRESS_ID = idBean.gromoreAdcodes_main.groExpress APP_NEW_INTERSTITIAL_WEIGHT = it.newnIterstitialHalfRate.half
APP_OUT_AD_UNIT_FULL_NEW_INTERSTITIAL_ID = APP_FULL_NEW_INTERSTITIAL_WEIGHT = it.newnIterstitialHalfRate.full
idBean.gromoreAdcodes_outer_ordinary.groNewInterstitial
} }
} }
} }
......
...@@ -7,7 +7,6 @@ import java.io.Serializable; ...@@ -7,7 +7,6 @@ import java.io.Serializable;
*/ */
public class GroAdcodeBean implements Serializable { public class GroAdcodeBean implements Serializable {
/** /**
* groExpress : 946265897 * groExpress : 946265897
* groNewInterstitial : 946333578 * groNewInterstitial : 946333578
...@@ -34,6 +33,8 @@ public class GroAdcodeBean implements Serializable { ...@@ -34,6 +33,8 @@ public class GroAdcodeBean implements Serializable {
private GromoreAdcodesOuterOrdinaryDTO gromoreAdcodes_outer_ordinary; private GromoreAdcodesOuterOrdinaryDTO gromoreAdcodes_outer_ordinary;
private IterstitialHalfRate newnIterstitialHalfRate;
public GromoreAdcodesOrdinaryDTO getGromoreAdcodes_ordinary() { public GromoreAdcodesOrdinaryDTO getGromoreAdcodes_ordinary() {
return gromoreAdcodes_ordinary; return gromoreAdcodes_ordinary;
} }
...@@ -66,28 +67,26 @@ public class GroAdcodeBean implements Serializable { ...@@ -66,28 +67,26 @@ public class GroAdcodeBean implements Serializable {
this.gromoreAdcodes_outer_ordinary = gromoreAdcodes_outer_ordinary; this.gromoreAdcodes_outer_ordinary = gromoreAdcodes_outer_ordinary;
} }
public static class GromoreAdcodesOrdinaryDTO { public class GromoreAdcodesOrdinaryDTO implements Serializable {
private String groExpress; private String groExpress;
private String groNewInterstitial; private String groNewInterstitial;
private String groNewInterstitialHalf;
public String getGroExpress() { public String getGroExpress() {
return groExpress; return groExpress;
} }
public void setGroExpress(String groExpress) {
this.groExpress = groExpress;
}
public String getGroNewInterstitial() { public String getGroNewInterstitial() {
return groNewInterstitial; return groNewInterstitial;
} }
public void setGroNewInterstitial(String groNewInterstitial) { public String getGroNewInterstitialHalf() {
this.groNewInterstitial = groNewInterstitial; return groNewInterstitialHalf;
} }
} }
public static class GromoreAdcodesMainDTO { public class GromoreAdcodesMainDTO implements Serializable {
private String groVideo; private String groVideo;
private String groInterstitial; private String groInterstitial;
private String groExpress; private String groExpress;
...@@ -126,7 +125,7 @@ public class GroAdcodeBean implements Serializable { ...@@ -126,7 +125,7 @@ public class GroAdcodeBean implements Serializable {
} }
} }
public static class GromoreAdcodesOuterLockDTO { public class GromoreAdcodesOuterLockDTO implements Serializable {
private String groExpress; private String groExpress;
public String getGroExpress() { public String getGroExpress() {
...@@ -138,24 +137,39 @@ public class GroAdcodeBean implements Serializable { ...@@ -138,24 +137,39 @@ public class GroAdcodeBean implements Serializable {
} }
} }
public static class GromoreAdcodesOuterOrdinaryDTO { public class GromoreAdcodesOuterOrdinaryDTO implements Serializable {
private String groExpress; private String groExpress;
private String groNewInterstitial; private String groNewInterstitial;
private String groNewInterstitialHalf;
public String getGroExpress() { public String getGroExpress() {
return groExpress; return groExpress;
} }
public void setGroExpress(String groExpress) {
this.groExpress = groExpress;
}
public String getGroNewInterstitial() { public String getGroNewInterstitial() {
return groNewInterstitial; return groNewInterstitial;
} }
public void setGroNewInterstitial(String groNewInterstitial) { public String getGroNewInterstitialHalf() {
this.groNewInterstitial = groNewInterstitial; return groNewInterstitialHalf;
} }
} }
public class IterstitialHalfRate implements Serializable {
private int half;
private int full;
public int getHalf() {
return half;
}
public int getFull() {
return full;
}
}
public IterstitialHalfRate getNewnIterstitialHalfRate() {
return newnIterstitialHalfRate;
}
} }
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