pda/zhuike/src/main/java/com/novelbook/android/bean/AdSetting.java

148 lines
3.4 KiB
Java
Raw Normal View History

2019-06-02 13:30:01 +08:00
package com.novelbook.android.bean;
2019-06-14 00:24:34 +08:00
import com.novelbook.android.netutils.NetUtil;
import com.novelbook.android.utils.Constants;
2019-06-14 00:24:34 +08:00
2019-06-02 13:30:01 +08:00
public class AdSetting {
2019-06-14 00:24:34 +08:00
private boolean showAdsense;
2019-06-13 00:37:00 +08:00
private String[] appIds={};
private slot splash = new slot();
private slot splash2 = new slot();
private slot informationFlow = new slot();
private slot chapterBanner = new slot();
private slot chapterContentBanner = new slot();
private slot chapterEndBanner = new slot();
private slot pop = new slot();
2019-06-14 00:24:34 +08:00
private slot fixBanner = new slot();
private slot bigBanner = new slot();
2019-06-13 00:37:00 +08:00
public boolean isShowAdsense() {
2019-06-14 00:24:34 +08:00
return showAdsense && NetUtil.isNetworkConnected();
2019-06-02 13:30:01 +08:00
}
2019-06-13 00:37:00 +08:00
public void setShowAdsense(boolean showAdsense) {
this.showAdsense = showAdsense;
2019-06-02 13:30:01 +08:00
}
2019-06-13 00:37:00 +08:00
public String[] getAppIds() {
return appIds;
2019-06-02 13:30:01 +08:00
}
2019-06-13 00:37:00 +08:00
public slot getSplash() {
return splash;
}
public slot getSplash2() {
return splash2;
}
public slot getInformationFlow() {
return informationFlow;
}
public slot getChapterBanner() {
return chapterBanner;
}
public slot getChapterContentBanner() {
return chapterContentBanner;
}
public slot getChapterEndBanner() {
return chapterEndBanner;
}
public slot getPop() {
return pop;
}
2019-06-14 00:24:34 +08:00
public slot getFixBanner() {
return fixBanner;
}
public slot getBigBanner() {
return bigBanner;
}
2019-06-13 00:37:00 +08:00
public static String getAppID(int sourceType){
if( Constants.AD_SETTING==null || Constants.AD_SETTING.getAppIds()==null){
return "";
}
return Constants.AD_SETTING.getAppIds().length> sourceType-1 ? Constants.AD_SETTING.getAppIds()[sourceType-1] :"";
}
2019-06-14 00:24:34 +08:00
public class slot{
2019-06-13 00:37:00 +08:00
private boolean show;
private int source;
private int interval4Display;
private int pageCount4Display;
private String[] slotIds={};
private int lifeCycleSecond;
private int displayPosition;
public int getDisplayPosition() {
//return 1;
2019-06-13 00:37:00 +08:00
return displayPosition;
}
public void setDisplayPosition(int displayPosition) {
this.displayPosition = displayPosition;
}
public boolean isShow() {
2019-06-14 00:24:34 +08:00
return show && NetUtil.isNetworkConnected();
2019-06-13 00:37:00 +08:00
}
public void setShow(boolean show) {
this.show = show;
}
public int getSource() {
2019-06-14 00:24:34 +08:00
return source;
// return 1;
2019-06-13 00:37:00 +08:00
}
public void setSource(int source) {
this.source = source;
}
public int getInterval4Display() {
return interval4Display;
}
public void setInterval4Display(int interval4Display) {
this.interval4Display = interval4Display;
}
public int getPageCount4Display() {
return pageCount4Display;
}
public void setPageCount4Display(int pageCount4Display) {
this.pageCount4Display = pageCount4Display;
}
public String[] getSlotIds() {
return slotIds;
}
public void setSlotIds(String[] slotIds) {
this.slotIds = slotIds;
}
public int getLifeCycleSecond() {
return lifeCycleSecond;
}
public void setLifeCycleSecond(int lifeCycleSecond) {
this.lifeCycleSecond = lifeCycleSecond;
}
public String getSlotId(int sourceType){
if(sourceType>0 && slotIds!=null && slotIds.length >sourceType-1){
return slotIds[sourceType-1];
}
return "";
2019-06-02 13:30:01 +08:00
}
}
2019-06-13 00:37:00 +08:00
}