150 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			150 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| package com.novelbook.android.bean;
 | |
| 
 | |
| import com.novelbook.android.netutils.NetUtil;
 | |
| import com.novelbook.android.utils.Constants;
 | |
| 
 | |
| public class AdSetting {
 | |
|     private boolean showAdsense;
 | |
|     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();
 | |
|     private slot fixBanner = new slot();
 | |
|     private slot bigBanner = new slot();
 | |
|     public boolean isShowAdsense() {
 | |
|            return false;
 | |
|       // return showAdsense  && NetUtil.isNetworkConnected();
 | |
|     }
 | |
| 
 | |
|     public void setShowAdsense(boolean showAdsense) {
 | |
|         this.showAdsense = showAdsense;
 | |
|     }
 | |
| 
 | |
|     public String[] getAppIds() {
 | |
|         return appIds;
 | |
|     }
 | |
| 
 | |
|     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;
 | |
|     }
 | |
| 
 | |
|     public slot getFixBanner() {
 | |
|         return fixBanner;
 | |
|     }
 | |
| 
 | |
|     public slot getBigBanner() {
 | |
|         return bigBanner;
 | |
|     }
 | |
| 
 | |
|     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] :"";
 | |
|     }
 | |
| 
 | |
| 
 | |
|     public class slot{
 | |
|     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 2;
 | |
|          return displayPosition;
 | |
|     }
 | |
| 
 | |
|     public void setDisplayPosition(int displayPosition) {
 | |
|         this.displayPosition = displayPosition;
 | |
|     }
 | |
| 
 | |
|     public boolean isShow() {
 | |
|         //  return true;
 | |
|         return show && NetUtil.isNetworkConnected();
 | |
|     }
 | |
| 
 | |
|     public void setShow(boolean show) {
 | |
|         this.show = show;
 | |
|     }
 | |
| 
 | |
|     public int getSource() {
 | |
|           return source;
 | |
|         //  return 1 ;
 | |
|     }
 | |
| 
 | |
|     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 "";
 | |
|     }
 | |
| }
 | |
| } |