From 182135e945c8917d53346f4236657adeea4c346c Mon Sep 17 00:00:00 2001 From: mwang <8205347@qq.com> Date: Mon, 17 Jun 2019 23:58:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B9=A6=E6=9E=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=98=BE=E7=A4=BA=E8=A7=84=E5=88=99=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0google=20ad=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhuike/build.gradle | 38 ++++--- zhuike/proguard-rules.pro | 5 +- zhuike/src/main/AndroidManifest.xml | 11 +- .../novelbook/android/AD/SplashActivity.java | 2 +- .../android/AD/qq/SplashActivity.java | 2 +- .../android/AD/toutiao/TTAdManagerHolder.java | 2 +- .../com/novelbook/android/Activity_base.java | 102 ++++++++++++++++- .../android/Fragments/BasicFragment.java | 7 +- .../com/novelbook/android/ReadActivity.java | 2 +- .../android/adapter/BookListAdapter.java | 1 + .../com/novelbook/android/bean/AdSetting.java | 11 +- .../java/com/novelbook/android/db/Novel.java | 10 +- .../com/novelbook/android/utils/AdUtil.java | 4 +- .../com/novelbook/android/utils/BookUtil.java | 1 + .../novelbook/android/utils/Constants.java | 3 + .../novelbook/android/utils/PageFactory.java | 2 + zhuike/zhuike.iml | 106 ++++++++++++------ 17 files changed, 240 insertions(+), 69 deletions(-) diff --git a/zhuike/build.gradle b/zhuike/build.gradle index c631b6f..2b8a564 100644 --- a/zhuike/build.gradle +++ b/zhuike/build.gradle @@ -6,7 +6,7 @@ android { releaseConfig { keyAlias 'key0' keyPassword 'hello123' - storeFile file('E:/reading/android/asProjects/zhuike/mykeystore.jks') + storeFile file('E:/reading/android/asProjects/mykeystore.jks') storePassword 'hello123' } } @@ -17,8 +17,8 @@ android { applicationId "com.novelbook.android" minSdkVersion 19 //target 19 Android 4.4 以下版本仅占比4.1% targetSdkVersion 28 - versionCode 1 - versionName "v1.0" + versionCode 6 + versionName "v6.0" // testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -32,7 +32,8 @@ android { multiDexEnabled true //突破65535 manifestPlaceholders = [UMENG_CHANNEL_CALUE: "umeng"] //默认为uMeng - flavorDimensions "default" //debug时注销 + manifestPlaceholders = [MOBAPPID: "ca-app-pub-3940256099942544~3347511713"] + flavorDimensions "default" //debug时注销 } buildTypes { debug { @@ -49,7 +50,7 @@ android { shrinkResources false signingConfig signingConfigs.debug } - /* release { + release { // 暂时显示Log 。。。。。。。。。。。。。。。上线时关闭 buildConfigField "boolean", "LOG_DEBUG", "true" //混淆 @@ -59,8 +60,9 @@ android { // 移除无用的resource文件 shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - - applicationVariants.all { variant -> + // versionCode 1 + // versionName "v1.0" + applicationVariants.all { variant -> variant.outputs.all { output -> def outFile = output.outputFile if (outFile != null && outFile.name.endsWith(".apk")) { @@ -72,11 +74,17 @@ android { } signingConfig signingConfigs.releaseConfig - }*/ + } } //渠道 - /* productFlavors { + productFlavors { // googleplay {} + google { + applicationId "com.zhushou.yueshu" + versionName "v1.0" + buildConfigField "String", "MAIN_HOST", '"http://g.xiaoshuofenxiang.com/api/"' + buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/g.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"' + } ali { applicationId "com.zhushou.wangshu" versionName "v1.0" @@ -144,7 +152,7 @@ android { buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/g.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"' } - *//* wzzw { + wzzw { applicationId "com.novelbook.android.wzzw" versionName "v-wzzw-5.0" buildConfigField "String", "MAIN_HOST", '"http://chwzzw.xiaoshuofenxiang.com/api/"' @@ -164,13 +172,13 @@ android { buildConfigField "String", "MAIN_HOST", '"http://chg.xiaoshuofenxiang.com/api/"' buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/g.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\/r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\/s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\/n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\/nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\/u.xiaoshuofenxiang.com\\"]}"' // buildConfigField "String", "API_HOST", '""' - }*//* + } //批量配置 productFlavors.all { flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name] } - }*/ + } android { lintOptions { abortOnError false @@ -235,11 +243,9 @@ dependencies { implementation 'com.github.ixiaow:multilayout:1.0.0' implementation 'com.umeng.umsdk:analytics:8.0.2' implementation 'com.umeng.umsdk:common:2.0.2' - - implementation 'q.rorbin:VerticalTabLayout:1.2.5' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.16' - - implementation(name: 'open_ad_sdk', ext:'aar') + implementation(name: 'open_ad_sdk', ext: 'aar') implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.6' + // implementation 'com.google.android.gms:play-services-ads:17.2.1' } diff --git a/zhuike/proguard-rules.pro b/zhuike/proguard-rules.pro index 65a2843..7900d77 100644 --- a/zhuike/proguard-rules.pro +++ b/zhuike/proguard-rules.pro @@ -279,4 +279,7 @@ -keep class com.bytedance.sdk.openadsdk.** { *; } -keep class com.androidquery.callback.** {*;} -keep public interface com.bytedance.sdk.openadsdk.downloadnew.** {*;} --keep class com.ss.sys.ces.* {*;} \ No newline at end of file +-keep class com.ss.sys.ces.* {*;} + +#GOOGLE MOBAD +-keep com.google.android.gms.ads.** { *; } diff --git a/zhuike/src/main/AndroidManifest.xml b/zhuike/src/main/AndroidManifest.xml index a9a6e2d..5601e18 100644 --- a/zhuike/src/main/AndroidManifest.xml +++ b/zhuike/src/main/AndroidManifest.xml @@ -6,7 +6,7 @@ - + @@ -197,8 +197,13 @@ - - + + + + + \ No newline at end of file diff --git a/zhuike/src/main/java/com/novelbook/android/AD/SplashActivity.java b/zhuike/src/main/java/com/novelbook/android/AD/SplashActivity.java index cb58051..a0799c9 100644 --- a/zhuike/src/main/java/com/novelbook/android/AD/SplashActivity.java +++ b/zhuike/src/main/java/com/novelbook/android/AD/SplashActivity.java @@ -46,7 +46,7 @@ import java.util.Map; import butterknife.BindView; import butterknife.ButterKnife; -import static com.novelbook.android.utils.AdUtil.getAppID; +import static com.novelbook.android.bean.AdSetting.getAppID; /** diff --git a/zhuike/src/main/java/com/novelbook/android/AD/qq/SplashActivity.java b/zhuike/src/main/java/com/novelbook/android/AD/qq/SplashActivity.java index 82833f0..1dacd8c 100644 --- a/zhuike/src/main/java/com/novelbook/android/AD/qq/SplashActivity.java +++ b/zhuike/src/main/java/com/novelbook/android/AD/qq/SplashActivity.java @@ -32,7 +32,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static com.novelbook.android.utils.AdUtil.getAppID; +import static com.novelbook.android.bean.AdSetting.getAppID; /** * 这是demo工程的入口Activity,在这里会首次调用广点通的SDK。 diff --git a/zhuike/src/main/java/com/novelbook/android/AD/toutiao/TTAdManagerHolder.java b/zhuike/src/main/java/com/novelbook/android/AD/toutiao/TTAdManagerHolder.java index 1867c7a..bd0fbfc 100644 --- a/zhuike/src/main/java/com/novelbook/android/AD/toutiao/TTAdManagerHolder.java +++ b/zhuike/src/main/java/com/novelbook/android/AD/toutiao/TTAdManagerHolder.java @@ -11,7 +11,7 @@ import com.bytedance.sdk.openadsdk.TTAdSdk; import com.novelbook.android.BuildConfig; import com.novelbook.android.utils.Constants; -import static com.novelbook.android.utils.AdUtil.getAppID; +import static com.novelbook.android.bean.AdSetting.getAppID; /** * 可以用一个单例来保存TTAdManager实例,在需要初始化sdk的时候调用 diff --git a/zhuike/src/main/java/com/novelbook/android/Activity_base.java b/zhuike/src/main/java/com/novelbook/android/Activity_base.java index 428312a..7b24a35 100644 --- a/zhuike/src/main/java/com/novelbook/android/Activity_base.java +++ b/zhuike/src/main/java/com/novelbook/android/Activity_base.java @@ -41,9 +41,15 @@ import com.bytedance.sdk.openadsdk.TTFeedAd; import com.bytedance.sdk.openadsdk.TTImage; import com.bytedance.sdk.openadsdk.TTInteractionAd; import com.bytedance.sdk.openadsdk.TTNativeAd; +import com.google.android.gms.ads.AdListener; +/*import com.google.android.gms.ads.AdRequest; +import com.google.android.gms.ads.AdSize; +import com.google.android.gms.ads.AdView; +import com.google.android.gms.ads.MobileAds;*/ import com.google.gson.Gson; import com.novelbook.android.AD.toutiao.TTAdManagerHolder; +import com.novelbook.android.bean.AdSetting; import com.novelbook.android.db.Novel; import com.novelbook.android.netutils.NetUtil; @@ -84,7 +90,8 @@ import org.litepal.util.Const; import butterknife.BindView; import butterknife.ButterKnife; -import static com.novelbook.android.utils.AdUtil.getAppID; + +import static com.novelbook.android.utils.Constants.AD_MOB; import static com.novelbook.android.utils.Constants.AD_TENCENT_QQ; import static com.novelbook.android.utils.Constants.AD_TOUTIAO; @@ -141,7 +148,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native setupToolbar(); // 初始化View注入 this.mAQuery = new AQuery2(this); - initAD_TouTiao(); + initializeAd();//initAD_TouTiao(); setTitle(); initData(); initViews(); @@ -432,18 +439,26 @@ public abstract class Activity_base extends AppCompatActivity implements Native return; } - Log.d(TAG, "loadBanner:mLastBannerTime start new banner request"); + Log.d(TAG, "loadBanner:mLastBannerTime start new banner request,mBannerContainer.getChildCount(): "+mBannerContainer.getChildCount()); if(Constants.AD_SETTING.getChapterBanner().getSource()== AD_TENCENT_QQ) { getBanner_qq(); }else if(Constants.AD_SETTING.getChapterBanner().getSource()== AD_TOUTIAO) { loadBanner_toutiao(mBannerContainer, width,height); + }else if(Constants.AD_SETTING.getChapterBanner().getSource()== AD_MOB){ + //loadBanner_Mob(mBannerContainer, width,height); } } + void initializeAd(){ + if(Constants.AD_SETTING.isShowAdsense()) { + initAD_TouTiao(); + initialMobileAd(); + } + } -//------ 头条 ad ----- + //------ 头条 ad ----- AQuery2 mAQuery; Button mCreativeButton; TTAdNative mTTAdNative; @@ -1065,7 +1080,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native } this.bv = new BannerView(this, com.qq.e.ads.banner.ADSize.BANNER, - getAppID(Constants.AD_TENCENT_QQ), + AdSetting.getAppID(Constants.AD_TENCENT_QQ), Constants.AD_SETTING.getChapterBanner().getSlotId(Constants.AD_TENCENT_QQ)); // 注意:如果开发者的banner不是始终展示在屏幕中的话,请关闭自动刷新,否则将导致曝光率过低。 // 并且应该自行处理:当banner广告区域出现在屏幕后,再手动loadAD。 @@ -1106,7 +1121,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native nativeExpressAD = new NativeExpressAD(this, getMyADSize(adWidth, adHeight), - getAppID(Constants.AD_TENCENT_QQ), + AdSetting.getAppID(Constants.AD_TENCENT_QQ), Constants.AD_SETTING.getChapterContentBanner().getSlotId(Constants.AD_TENCENT_QQ), this); // 这里的Context必须为Activity /* nativeExpressAD.setVideoOption(new VideoOption.Builder() .setAutoPlayPolicy(VideoOption.AutoPlayPolicy.WIFI) // 设置什么网络环境下可以自动播放视频 @@ -1314,8 +1329,83 @@ public abstract class Activity_base extends AppCompatActivity implements Native Log.i(TAG, "onVideoPageClose"); } }; +//------------------------AD Google MobileAds--------------- + // MobileAds.initialize(this, "YOUR_ADMOB_APP_ID"); + + /* boolean isMobleAdInitialize =false; + AdView mAdView; + void initialMobileAd(){ + // Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 + String appID = AdSetting.getAppID(Constants.AD_MOB); + appID ="ca-app-pub-3940256099942544~3347511713"; + MobileAds.initialize(this, appID); + isMobleAdInitialize =true; + Log.d(TAG, "onAdLoaded: initialMobileAd "); + } + AdView getAdView(){ + if(mAdView ==null){ + mAdView = new AdView(this); + mAdView.setAdSize(AdSize.BANNER); + String codeId = "ca-app-pub-3940256099942544/6300978111";//Constants.AD_SETTING.getChapterBanner().getSlotId(Constants.AD_MOB) ; + mAdView.setAdUnitId(codeId); + mAdView.setAdListener(new AdListener() { + @Override + public void onAdLoaded() { + // Code to be executed when an ad finishes loading. + Log.d(TAG, "onAdLoaded: mobAd loaded"); + mLastBannerTime =new Date().getTime(); + } + + @Override + public void onAdFailedToLoad(int errorCode) { + // Code to be executed when an ad request fails. + Log.d(TAG, "onAdLoaded: Code to be executed when an ad request fails."); + } + + @Override + public void onAdOpened() { + // Code to be executed when an ad opens an overlay that + // covers the screen. + Log.d(TAG, "onAdLoaded: ad opens an overlay."); + } + + @Override + public void onAdClicked() { + // Code to be executed when the user clicks on an ad. + Log.d(TAG, "onAdLoaded: user clicks on an ad."); + } + + @Override + public void onAdLeftApplication() { + // Code to be executed when the user has left the app. + Log.d(TAG, "onAdLoaded: Code to be executed when the user has left the app."); + } + + @Override + public void onAdClosed() { + // Code to be executed when the user is about to return + // to the app after tapping on an ad. + Log.d(TAG, "onAdLoaded: Code to be executed when the user is about to return to the app after tapping on an ad."); + } + }); + } + return mAdView; + } + private void loadBanner_Mob(FrameLayout bannerContainer, int width, int height) { + Log.d(TAG, "onAdLoaded: 1 loadBanner_Mob "); + if(!Constants.AD_SETTING.isShowAdsense()){return;} + if(!isMobleAdInitialize){ + initialMobileAd(); + } + Log.d(TAG, "onAdLoaded: 2 loadBanner_Mob "); + AdRequest adRequest = new AdRequest.Builder().build(); + getAdView().loadAd(adRequest); + bannerContainer.removeAllViews(); + bannerContainer.addView( getAdView()); + + }*/ @Override diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/BasicFragment.java b/zhuike/src/main/java/com/novelbook/android/Fragments/BasicFragment.java index cc68e1b..7f0b45d 100644 --- a/zhuike/src/main/java/com/novelbook/android/Fragments/BasicFragment.java +++ b/zhuike/src/main/java/com/novelbook/android/Fragments/BasicFragment.java @@ -89,7 +89,7 @@ import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; -import static com.novelbook.android.utils.AdUtil.getAppID; +import static com.novelbook.android.bean.AdSetting.getAppID; /** @@ -266,6 +266,7 @@ void initTabs(){ nv = gson.fromJson(result,Novel.class); if(id>0) { nv.update(id); + nv.checkAndUpdate(); nv= LitePal.find(Novel.class,id); }else { nv.save(); @@ -468,8 +469,8 @@ void initTabs(){ if(bannerContainer==null){ return; } - // bannerContainer.setVisibility(View.GONE); - if (!Constants.AD_SETTING.isShowAdsense() || !Constants.AD_SETTING.getFixBanner().isShow() || !NetUtil.isNetworkConnected()) { + + if ( !Constants.AD_SETTING.isShowAdsense() || !Constants.AD_SETTING.getFixBanner().isShow() || !NetUtil.isNetworkConnected()) { mBannerContainer.setVisibility(View.GONE); return; } diff --git a/zhuike/src/main/java/com/novelbook/android/ReadActivity.java b/zhuike/src/main/java/com/novelbook/android/ReadActivity.java index 217eb80..14afd3c 100644 --- a/zhuike/src/main/java/com/novelbook/android/ReadActivity.java +++ b/zhuike/src/main/java/com/novelbook/android/ReadActivity.java @@ -570,7 +570,7 @@ public class ReadActivity extends Activity_base implements AdInterface { @Override protected void onDestroy() { super.onDestroy(); - // pageFactory.clear(); + pageFactory.clear(); bookpage = null; unregisterReceiver(myReceiver); isSpeaking = false; diff --git a/zhuike/src/main/java/com/novelbook/android/adapter/BookListAdapter.java b/zhuike/src/main/java/com/novelbook/android/adapter/BookListAdapter.java index 784b3e6..b882525 100644 --- a/zhuike/src/main/java/com/novelbook/android/adapter/BookListAdapter.java +++ b/zhuike/src/main/java/com/novelbook/android/adapter/BookListAdapter.java @@ -341,6 +341,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol if (holder.imageUpdate != null) { if( novel.isUpdated()){ + Log.d(TAG, String.format("checkshelf:novel %s has new update",novel.getName())); holder.imageUpdate.setVisibility(View.VISIBLE); }else{ holder.imageUpdate.setVisibility(View.GONE); diff --git a/zhuike/src/main/java/com/novelbook/android/bean/AdSetting.java b/zhuike/src/main/java/com/novelbook/android/bean/AdSetting.java index 7d1e1f7..bb73740 100644 --- a/zhuike/src/main/java/com/novelbook/android/bean/AdSetting.java +++ b/zhuike/src/main/java/com/novelbook/android/bean/AdSetting.java @@ -1,6 +1,7 @@ package com.novelbook.android.bean; import com.novelbook.android.netutils.NetUtil; +import com.novelbook.android.utils.Constants; public class AdSetting { private boolean showAdsense; @@ -62,6 +63,14 @@ public class AdSetting { 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; @@ -72,7 +81,7 @@ public class AdSetting { private int displayPosition; public int getDisplayPosition() { - //return 2; + //return 1; return displayPosition; } diff --git a/zhuike/src/main/java/com/novelbook/android/db/Novel.java b/zhuike/src/main/java/com/novelbook/android/db/Novel.java index fc9729d..0d74c86 100644 --- a/zhuike/src/main/java/com/novelbook/android/db/Novel.java +++ b/zhuike/src/main/java/com/novelbook/android/db/Novel.java @@ -307,7 +307,15 @@ public class Novel extends LitePalSupport implements Serializable{ } @Override public int update(long id){ - setValues();try { + setValues(); + checkAndUpdate(); + Log.d("checkshelf", String.format("checkshelf:novel %s going to update,isUpdated %s", getName() ,isUpdated)); + /* try { + throw new Exception("check update"); + }catch (Exception e){ + Log.e("checkshelf", "checkshelf ", e); + }*/ + try { return super.update(id); }catch (Exception e){ Log.e("NOVELDB", "update:error ", e); diff --git a/zhuike/src/main/java/com/novelbook/android/utils/AdUtil.java b/zhuike/src/main/java/com/novelbook/android/utils/AdUtil.java index 5f82f8e..aa06481 100644 --- a/zhuike/src/main/java/com/novelbook/android/utils/AdUtil.java +++ b/zhuike/src/main/java/com/novelbook/android/utils/AdUtil.java @@ -1,10 +1,10 @@ package com.novelbook.android.utils; public class AdUtil { - public static String getAppID(int sourceType){ + /* 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] :""; - } + }*/ } diff --git a/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java b/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java index 9f70ebd..4ee7391 100644 --- a/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java +++ b/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java @@ -260,6 +260,7 @@ public class BookUtil { mNovel.setDomain(mSite.getDomain()); mNovel.setDomainName(mSite.getName()); mNovel.setMuluUrl(mSite.getMuluUrl()); + mNovel.setToDefault("isUpdated"); mNovel.update(mNovel.getId()); } diff --git a/zhuike/src/main/java/com/novelbook/android/utils/Constants.java b/zhuike/src/main/java/com/novelbook/android/utils/Constants.java index dccc357..71c3466 100644 --- a/zhuike/src/main/java/com/novelbook/android/utils/Constants.java +++ b/zhuike/src/main/java/com/novelbook/android/utils/Constants.java @@ -19,9 +19,12 @@ public class Constants { public static AdSetting AD_SETTING; public static final int AD_TENCENT_QQ =1; public static final int AD_TOUTIAO =2; + public static final int AD_MOB =3; public static final int AD_BANNER_TOP =1; public static final int AD_BANNER_BOTTOM =2; + + public static boolean AD_BACKGROUND_TRANSPARENT =true ; public static boolean PRE_LOAD_CHAPT = false; public static int SCREEN_HEIGHT_PIX =1920 ; diff --git a/zhuike/src/main/java/com/novelbook/android/utils/PageFactory.java b/zhuike/src/main/java/com/novelbook/android/utils/PageFactory.java index c8c924a..cb1687d 100644 --- a/zhuike/src/main/java/com/novelbook/android/utils/PageFactory.java +++ b/zhuike/src/main/java/com/novelbook/android/utils/PageFactory.java @@ -2127,6 +2127,8 @@ private void hideSysUI(){ public void clear(){ // Log.d(TAG, String .format("prepare Book: clearing book info %s" , getNovle().getName())); + mBookUtil.clear(); + mBookUtil=null; fileRetryCnt.clear(); lastPageTime=0; if(chaptMap!=null){ diff --git a/zhuike/zhuike.iml b/zhuike/zhuike.iml index 1106ac4..0a919f9 100644 --- a/zhuike/zhuike.iml +++ b/zhuike/zhuike.iml @@ -8,38 +8,80 @@ - - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -87,56 +129,52 @@ - - - - - - - - - + - + + - - + + + + + @@ -152,6 +190,7 @@ + @@ -192,6 +231,7 @@ + @@ -204,6 +244,7 @@ + @@ -220,6 +261,7 @@ +