From 31e55ab093fe76c5079eacac13b34462cd41cf54 Mon Sep 17 00:00:00 2001
From: mwang <8205347@qq.com>
Date: Sat, 29 Jun 2019 22:47:08 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9D=83=E9=99=90=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
zhuike/build.gradle | 62 +--
zhuike/src/main/AndroidManifest.xml | 10 +-
.../novelbook/android/AD/SplashActivity.java | 26 +-
.../android/AD/toutiao/TTAdManagerHolder.java | 33 +-
.../com/novelbook/android/Activity_base.java | 380 +++++++++++++++---
.../com/novelbook/android/BookActivity.java | 8 +-
.../android/Fragments/BasicFragment.java | 161 +-------
.../android/Fragments/Fragment_Shelf.java | 9 +-
.../android/Fragments/Fragment_booklist.java | 22 +-
.../com/novelbook/android/Main2Activity.java | 9 +-
.../com/novelbook/android/MarkActivity.java | 6 +-
.../java/com/novelbook/android/MyApp.java | 12 +-
.../com/novelbook/android/ReadActivity.java | 4 +-
.../android/adapter/BookListAdapter.java | 43 +-
.../com/novelbook/android/netapi/HttpApi.java | 5 +
.../android/netsubscribe/BookSubscribe.java | 27 ++
.../novelbook/android/netutils/NetUtil.java | 3 +-
.../android/permision/RuntimeRationale.java | 63 +++
.../android/upgrade/UpdateManager.java | 18 +-
.../com/novelbook/android/utils/BookUtil.java | 83 +++-
.../novelbook/android/utils/CommonUtil.java | 75 +++-
.../com/novelbook/android/utils/Config.java | 2 +-
.../novelbook/android/utils/Constants.java | 11 +-
.../drawable-v21/toutiao_splash_banner.png | Bin 4590 -> 0 bytes
.../main/res/layout/ad_qq_activity_splash.xml | 1 +
.../main/res/layout/ad_toutiao_native_ad.xml | 12 +-
.../src/main/res/layout/fragment_bangdans.xml | 2 +-
zhuike/src/main/res/values/colors.xml | 3 +
zhuike/src/main/res/values/strings.xml | 15 +-
zhuike/zhuike.iml | 14 +-
30 files changed, 726 insertions(+), 393 deletions(-)
create mode 100644 zhuike/src/main/java/com/novelbook/android/permision/RuntimeRationale.java
delete mode 100644 zhuike/src/main/res/drawable-v21/toutiao_splash_banner.png
diff --git a/zhuike/build.gradle b/zhuike/build.gradle
index d24a615..9f495d7 100644
--- a/zhuike/build.gradle
+++ b/zhuike/build.gradle
@@ -13,8 +13,8 @@ android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
- // applicationId "com.qq.e.union.demo"
- applicationId "com.zhushou.yueshu"
+ applicationId "com.novelbook.android"
+ // applicationId "com.zhushou.yueshu"
minSdkVersion 19 //target 19 Android 4.4 以下版本仅占比4.1%
targetSdkVersion 28
versionCode 6
@@ -40,7 +40,7 @@ android {
// 显示Log
buildConfigField "boolean", "LOG_DEBUG", "true"
buildConfigField "String", "MAIN_HOST", '"http://dg.xiaoshuofenxiang.com/api/"'
- // buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/dg.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/d.p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\//d.r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\//d.s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\//d.n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\//d.nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\//d.u.xiaoshuofenxiang.com\\"]}"'
+ // buildConfigField "String", "API_HOST", '"{\\"master\\":[\\"http:\\\\/\\\\/dg.xiaoshuofenxiang.com\\"],\\"page\\":[\\"http:\\\\/\\\\/d.p.xiaoshuofenxiang.com\\"],\\"report\\":[\\"http:\\\\/\\\\//d.r.xiaoshuofenxiang.com\\"],\\"search\\":[\\"http:\\\\/\\\\//d.s.xiaoshuofenxiang.com\\"],\\"novel\\":[\\"http:\\\\/\\\\//d.n.xiaoshuofenxiang.com\\"],\\"novelsbydot\\":[\\"http:\\\\/\\\\//d.nbd.xiaoshuofenxiang.com\\"],\\"user\\":[\\"http:\\\\/\\\\//d.u.xiaoshuofenxiang.com\\"]}"'
buildConfigField "String", "API_HOST", '""'
// buildConfigField "String", "CHANNEL",'"DEBUG"'
@@ -52,7 +52,7 @@ android {
}
release {
// 暂时显示Log 。。。。。。。。。。。。。。。上线时关闭
- buildConfigField "boolean", "LOG_DEBUG", "true"
+ buildConfigField "boolean", "LOG_DEBUG", "false"
//混淆
minifyEnabled true
//Zipalign优化
@@ -62,58 +62,35 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// versionCode 1
// versionName "v1.0"
- /* applicationVariants.all { variant ->
- variant.outputs.all { output ->
- def outFile = output.outputFile
- if (outFile != null && outFile.name.endsWith(".apk")) {
- def fileName = "${defaultConfig.versionName}-" + "${releaseTime()}" + "-${variant.productFlavors[0].name}" + ".apk"
+ /*applicationVariants.all { variant ->
+ variant.outputs.all { output ->
+ def outFile = output.outputFile
+ if (outFile != null && outFile.name.endsWith(".apk")) {
+ def fileName = "${defaultConfig.versionName}-" + "${releaseTime()}" + "-${variant.productFlavors[0].name}" + ".apk"
- outputFileName = fileName;
- }
- }
-
- }*/
+ outputFileName = fileName;
+ }
+ }
+ }*/
signingConfig signingConfigs.releaseConfig
}
}
//渠道
-/* productFlavors {
+ /*productFlavors {
// googleplay {}
- yingyonghui {
- 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\\"]}"'
-
- }
- yiwan {
+ g {
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\\"]}"'
+ buildConfigField "String", "API_HOST", '""'
}
- haote {
- 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\\"]}"'
-
- }
-
- anzhi {
- 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\\"]}"'
-
- }
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\\"]}"'
+ buildConfigField "String", "API_HOST", '""'
}
//批量配置
@@ -188,7 +165,8 @@ dependencies {
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 'pl.droidsonroids.gif:android-gif-drawable:1.2.6'
+ //穿山甲广告
+ // implementation(name: 'open_ad_sdk', ext: 'aar')
implementation 'com.google.android.gms:play-services-ads:17.2.1'
+ // implementation 'com.yanzhenjie:permission:2.0.0'
}
diff --git a/zhuike/src/main/AndroidManifest.xml b/zhuike/src/main/AndroidManifest.xml
index 500fd74..4356517 100644
--- a/zhuike/src/main/AndroidManifest.xml
+++ b/zhuike/src/main/AndroidManifest.xml
@@ -6,9 +6,10 @@
+
-
+
@@ -161,8 +162,8 @@
--->
-
+
+
- private TTAdNative mTTAdNative;
+ //private TTAdNative mTTAdNative;
//是否强制跳转到主页面
private boolean mForceGoMain;
@@ -123,6 +123,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean isGoToMain= getIntent().getBooleanExtra(EXTR_LUNCHER,true);
+ Log.d(TAG, String.format("onCreate: isGotoMain %s,showAd %s",isGoToMain,Constants.AD_SETTING.isShowAdsense()));
if(!Constants.AD_SETTING.isShowAdsense() ||isGoToMain && !Constants.AD_SETTING.getSplash().isShow() ){
goToMainActivity();
return;
@@ -133,8 +134,9 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
if (Constants.AD_SETTING.getSplash().getSource() == Constants.AD_TENCENT_QQ) {
rid = R.layout.ad_qq_activity_splash;
} else if (Constants.AD_SETTING.getSplash().getSource() == Constants.AD_TOUTIAO) {
- rid = R.layout.ad_toutiao_activity_splash;
- splashSource=Constants.AD_TOUTIAO;
+ /* rid = R.layout.ad_toutiao_activity_splash;
+ splashSource=Constants.AD_TOUTIAO;*/
+ goToMainActivity();return;
}
else{
goToMainActivity();return;
@@ -176,7 +178,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
tvTitle.setText(R.string.app_name);
//加载开屏广告
if(splashSource == Constants.AD_TOUTIAO ) {
- mHandler.sendEmptyMessageDelayed(MSG_GO_MAIN, AD_TIME_OUT);
+ /* mHandler.sendEmptyMessageDelayed(MSG_GO_MAIN, AD_TIME_OUT);
//step2:创建TTAdNative对象
try {
mTTAdNative = TTAdManagerHolder.get().createAdNative(this);
@@ -184,7 +186,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
goToMainActivity();
return;
}
- loadSplashAd();
+ loadSplashAd();*/
}else if(splashSource == Constants.AD_TENCENT_QQ ){
if (Build.VERSION.SDK_INT >= 23) {
checkAndRequestPermission();
@@ -254,7 +256,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
/**
* 加载开屏广告
*/
- private void loadSplashAd() {
+ /*private void loadSplashAd() {
//step3:创建开屏广告请求参数AdSlot,具体参数含义参考文档
AdSlot adSlot = new AdSlot.Builder()
.setCodeId(Constants.AD_SETTING.getSplash().getSlotId(Constants.AD_TOUTIAO) )
@@ -329,7 +331,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
});
}
}, AD_TIME_OUT);
- }
+ }*/
private void showToast(String msg) {
@@ -382,7 +384,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
lackedPermission.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
if (!(checkSelfPermission(Manifest.permission.REQUEST_INSTALL_PACKAGES) == PackageManager.PERMISSION_GRANTED)) {
- CommonUtil.checkPermission(this,Manifest.permission.REQUEST_INSTALL_PACKAGES,1024,"更新程序内容需此权限,请允许");
+ CommonUtil.checkPermission(this,Manifest.permission.REQUEST_INSTALL_PACKAGES,1024,"更新程序内容需此权限,请允许");
//lackedPermission.add(Manifest.permission.REQUEST_INSTALL_PACKAGES);
}
/*if (!(checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)) {
@@ -405,7 +407,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
String[] requestPermissions = new String[lackedPermission.size()];
lackedPermission.toArray(requestPermissions);
Log.d(TAG, String.format("checkAndRequestPermission: lacked permission size %s",requestPermissions.length));
- requestPermissions(requestPermissions, 1024);
+ // requestPermissions(requestPermissions, 1024);
}
}
@@ -416,7 +418,7 @@ public class SplashActivity extends Activity implements WeakHandler.IHandler, Sp
if (grantResult == PackageManager.PERMISSION_DENIED) {
- // return false;
+ // return false;
}
}
return true;
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 bd0fbfc..d383597 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
@@ -1,6 +1,6 @@
package com.novelbook.android.AD.toutiao;
-import android.content.Context;
+/*import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
@@ -11,13 +11,28 @@ import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.novelbook.android.BuildConfig;
import com.novelbook.android.utils.Constants;
-import static com.novelbook.android.bean.AdSetting.getAppID;
+import static com.novelbook.android.bean.AdSetting.getAppID;*/
+
+import android.content.Context;
/**
* 可以用一个单例来保存TTAdManager实例,在需要初始化sdk的时候调用
*/
public class TTAdManagerHolder {
-
+ //step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明
+ private static void doInit(Context context) {
+ /* if (!sInit) {
+ TTAdSdk.init(context, buildConfig(context));
+ sInit = true;
+ }*/
+ }
+ public static void init(Context context) {
+ /* if( Constants.AD_SETTING.isShowAdsense() &&
+ !TextUtils.isEmpty(getAppID(Constants.AD_TOUTIAO)) ) {
+ doInit(context);
+ }*/
+ }
+/*
private static boolean sInit;
public static TTAdManager get() {
@@ -34,13 +49,7 @@ public class TTAdManagerHolder {
}
}
- //step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明
- private static void doInit(Context context) {
- if (!sInit) {
- TTAdSdk.init(context, buildConfig(context));
- sInit = true;
- }
- }
+
private static TTAdConfig buildConfig(Context context) {
@@ -59,8 +68,8 @@ public class TTAdManagerHolder {
// .age(20) //TODO: 年龄收集
.build();
- }
+ }*/
public static void initOnSexChange(Context context){
- buildConfig(context);
+ // buildConfig(context);
}
}
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 38bc151..7c73ce9 100644
--- a/zhuike/src/main/java/com/novelbook/android/Activity_base.java
+++ b/zhuike/src/main/java/com/novelbook/android/Activity_base.java
@@ -4,19 +4,30 @@ import android.Manifest;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ProgressDialog;
+import android.content.Context;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.graphics.Point;
+import android.location.LocationManager;
+import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.provider.Settings;
+import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
+import android.support.annotation.StringRes;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
+import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -29,21 +40,20 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
-
-import com.androidquery.AQuery;
-import com.androidquery.callback.AQuery2;
import com.androidquery.callback.ImageOptions;
+
+/*import com.androidquery.AQuery;
+import com.androidquery.callback.AQuery2;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdDislike;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
import com.bytedance.sdk.openadsdk.TTBannerAd;
-
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.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;
@@ -57,6 +67,7 @@ import com.novelbook.android.db.Novel;
import com.novelbook.android.netutils.NetUtil;
+//import com.novelbook.android.permision.RuntimeRationale;
import com.novelbook.android.upgrade.UpdateManager;
import com.novelbook.android.utils.CommonUtil;
@@ -89,19 +100,25 @@ import com.qq.e.ads.nativ.NativeUnifiedADData;
import com.qq.e.comm.constants.AdPatternType;
import com.qq.e.comm.pi.AdData;
import com.qq.e.comm.util.AdError;
+/*import com.yanzhenjie.permission.Action;
+import com.yanzhenjie.permission.AndPermission;
+import com.yanzhenjie.permission.runtime.Permission;*/
+import org.litepal.BuildConfig;
import org.litepal.util.Const;
import butterknife.BindView;
import butterknife.ButterKnife;
+import static com.novelbook.android.FileActivity.EXTERNAL_STORAGE_REQ_CODE;
+import static com.novelbook.android.bean.AdSetting.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;
public abstract class Activity_base extends AppCompatActivity implements NativeExpressAD.NativeExpressADListener,UnifiedBannerADListener {
-
+ private final int REQUEST_CODE_SETTING=1;
private static final int MSG_AD_LOAD =10 ;
private static String TAG ="Activity_base";
private ProgressDialog mProgressDialog;
@@ -112,6 +129,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native
//---qq ad---->
private NativeExpressAD nativeExpressAD;
private NativeExpressADView nativeExpressADView;
+ private QqNadListiner qqNadListiner;
//---qq ad end----
@Nullable
@BindView(R.id.toolbar)
@@ -153,41 +171,17 @@ public abstract class Activity_base extends AppCompatActivity implements Native
ButterKnife.bind(this);
setupToolbar();
// 初始化View注入
- this.mAQuery = new AQuery2(this);
+ // this.mAQuery = new AQuery2(this);
initializeAd();//initAD_TouTiao();
setTitle();
initData();
initViews();
initNaviBanner();
if (Build.VERSION.SDK_INT >= 23) {
- checkAndRequestPermission();
+ checkAndRequestPermission();
}
}
- @TargetApi(Build.VERSION_CODES.M)
- private void checkAndRequestPermission() {
- List lackedPermission = new ArrayList();
- if (!(checkSelfPermission(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED)) {
- lackedPermission.add(Manifest.permission.READ_PHONE_STATE);
- }
- if (!(checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)) {
- lackedPermission.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
- }
-
- if (!(checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)) {
- lackedPermission.add(Manifest.permission.ACCESS_FINE_LOCATION);
- }
-
-
-
- // 请求所缺少的权限,在onRequestPermissionsResult中再看是否获得权限,如果获得权限就可以调用SDK,否则不要调用SDK。
- String[] requestPermissions = new String[lackedPermission.size()];
- if(requestPermissions.length>0) {
- lackedPermission.toArray(requestPermissions);
- requestPermissions(requestPermissions, 1024);
- }
-
- }
void initNaviBanner(){
if(mBannerContainer==null){
return;
@@ -382,7 +376,162 @@ public abstract class Activity_base extends AppCompatActivity implements Native
* @param errorText
*/
protected void checkPermission (Activity thisActivity, String permission, int requestCode, String errorText) {
- CommonUtil.checkPermission(thisActivity,permission,requestCode,errorText);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ CommonUtil.checkPermission(thisActivity,permission,requestCode,errorText);
+ }
+
+ }
+ @TargetApi(Build.VERSION_CODES.M)
+ public void checkAndRequestPermission() {
+ List lackedPermission = new ArrayList();
+ if (!(checkSelfPermission(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED)) {
+ lackedPermission.add(Manifest.permission.READ_PHONE_STATE);
+ // CommonUtil.checkPermission(this,Manifest.permission.READ_PHONE_STATE,1024,"识别用户身份需要此权限,请允许");
+ // return;
+ }
+
+ if (!(checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)) {
+ lackedPermission.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
+ // CommonUtil.checkPermission(this,Manifest.permission.WRITE_EXTERNAL_STORAGE,1024,"缓存小说内容需此权限,请允许");
+ // return;
+ }
+ if(com.novelbook.android.BuildConfig.LOG_DEBUG || Constants.AD_SETTING.isShowAdsense() && Constants.AD_SETTING.getSplash().getSource() == AD_TENCENT_QQ)
+ if (!(checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED)) {
+
+ lackedPermission.add(Manifest.permission.ACCESS_FINE_LOCATION);
+ // CommonUtil.checkPermission(this,Manifest.permission.ACCESS_FINE_LOCATION,1024,"精确推送小说内容需此权限,请允许");
+
+ Log.e(TAG, "checkAndRequestPermission: ACCESS_FINE_LOCATION result " + checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) );
+ // return;
+ }
+ if(com.novelbook.android.BuildConfig. LOG_DEBUG || Constants.AD_SETTING.isShowAdsense() && Constants.AD_SETTING.getSplash().getSource() == AD_TENCENT_QQ)
+ if (!(checkSelfPermission(Manifest.permission.REQUEST_INSTALL_PACKAGES) == PackageManager.PERMISSION_GRANTED)) {
+ // CommonUtil.checkPermission(this,Manifest.permission.REQUEST_INSTALL_PACKAGES,1024,"更新程序内容需此权限,请允许");
+ lackedPermission.add(Manifest.permission.REQUEST_INSTALL_PACKAGES);
+ // return;
+ }
+
+ // 请求所缺少的权限,在onRequestPermissionsResult中再看是否获得权限,如果获得权限就可以调用SDK,否则不要调用SDK。
+ String[] requestPermissions = new String[lackedPermission.size()];
+ if(requestPermissions.length>0) {
+ lackedPermission.toArray(requestPermissions);
+ requestPermissions(requestPermissions, 1024);
+ String p = "";
+ for(String s: requestPermissions) {
+
+ p+="," +s;
+
+ }
+ if(requestPermissions.length>0){
+ p =p.substring(1);
+ Log.e(TAG, "checkAndRequestPermission: 缺少权限 " + p);
+ //requestPermission(this,p);
+ }
+
+ }
+
+ }
+ private boolean hasAllPermissionsGranted(int[] grantResults) {
+ for (int grantResult : grantResults) {
+
+ Log.e(TAG, "checkAndRequestPermission: grant result "+grantResult );
+
+
+ if (grantResult == PackageManager.PERMISSION_DENIED) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+ if (requestCode == 1024 && hasAllPermissionsGranted(grantResults)) {
+
+ } else {
+ Log.d(TAG, String.format("checkAndRequestPermission: permision result requestCode %s,",requestCode ));
+ // 如果用户没有授权,那么应该说明意图,引导用户去设置里面授权。
+ Toast.makeText(this, "应用缺少必要的权限!请点击\"权限\",打开所需要的权限。", Toast.LENGTH_LONG).show();
+// Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+// intent.setData(Uri.parse("package:" + getPackageName()));
+ // startActivity(intent);
+
+
+
+ }
+ }
+
+
+ /**
+ * Request permissions.
+ */
+ /* private void requestPermission(Context activity, String... permissions) {
+ AndPermission.with(activity)
+ .runtime()
+ .permission(permissions)
+ .rationale(new RuntimeRationale())
+ .onGranted(new Action>() {
+ @Override
+ public void onAction(List permissions) {
+ toast(R.string.permision_successfully);
+ }
+ })
+ .onDenied(new Action>() {
+ @Override
+ public void onAction(@NonNull List permissions) {
+ toast(R.string.permision_failure);
+ if (AndPermission.hasAlwaysDeniedPermission( activity, permissions)) {
+ showSettingDialog(activity, permissions);
+ }
+ }
+ })
+ .start();
+ }
+
+ *//**
+ * Display setting dialog.
+ *//*
+ public void showSettingDialog(Context context, final List permissions) {
+ List permissionNames = Permission.transformText(context, permissions);
+ String message = context.getString(R.string.message_permission_always_failed,
+ TextUtils.join("\n", permissionNames));
+
+ new AlertDialog.Builder(context).setCancelable(false)
+ .setTitle(R.string.title_dialog)
+ .setMessage(message)
+ .setPositiveButton(R.string.setting, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ setPermission();
+ }
+ })
+ .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ }
+ })
+ .show();
+ }
+
+ *//**
+ * Set permissions.
+ *//*
+ private void setPermission() {
+ AndPermission.with(this).runtime().setting().start(REQUEST_CODE_SETTING);
+ }
+*/
+ protected void toast(@StringRes int message) {
+ Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
+ }
+ @Override
+ protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
+ switch (requestCode) {
+ case REQUEST_CODE_SETTING: {
+ Toast.makeText( this, R.string.message_setting_comeback, Toast.LENGTH_SHORT).show();
+ break;
+ }
+ }
}
protected void loadImageView(String url, ImageView imageView){
@@ -440,7 +589,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native
if(Constants.AD_SETTING.getChapterContentBanner().getSource() == AD_TENCENT_QQ) {
loadNativeBanner_qq(-1, 388);
}else if(Constants.AD_SETTING.getChapterContentBanner().getSource() == AD_TOUTIAO) {
- loadNativeBanner_toutiao(mBannerContainer ,690,388);
+ // loadNativeBanner_toutiao(mBannerContainer ,690,388);
}else if(Constants.AD_SETTING.getChapterContentBanner().getSource() == AD_MOB) {
loadBanner_Mob(mBannerContainer, 699,388);
}
@@ -463,7 +612,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native
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);
+ // loadBanner_toutiao(mBannerContainer, width,height);
}else if(Constants.AD_SETTING.getChapterBanner().getSource()== AD_MOB){
loadBanner_Mob(mBannerContainer, width,height);
@@ -473,13 +622,14 @@ public abstract class Activity_base extends AppCompatActivity implements Native
void initializeAd(){
if(Constants.AD_SETTING.isShowAdsense()) {
- initAD_TouTiao();
+ // initAD_TouTiao();
+ qqNadListiner = new QqNadListiner() ;
// initialMobileAd();
}
}
//------ 头条 ad -----
- AQuery2 mAQuery;
+ /*AQuery2 mAQuery;
Button mCreativeButton;
TTAdNative mTTAdNative;
void initAD_TouTiao(){
@@ -503,10 +653,11 @@ public abstract class Activity_base extends AppCompatActivity implements Native
}
return mTTAdNative;
}
+*/
-
+/*
//----toutiao ad ----
// boolean mShowAd =false;
@@ -514,7 +665,8 @@ public abstract class Activity_base extends AppCompatActivity implements Native
//step4:创建广告请求参数AdSlot,具体参数含义参考文档
if(!Constants.AD_SETTING.isShowAdsense() || getTTAdNative()==null ){return;}
String codeId = Constants.AD_SETTING.getChapterBanner().getSlotId(Constants.AD_TOUTIAO) ;
- /* if(height >390){
+ */
+/* if(height >390){
width =(int)(height*1.78);
if(width > Constants.SCREEN_WIDTH_PIX-50 ){
width= Constants.SCREEN_WIDTH_PIX-50;
@@ -522,7 +674,8 @@ public abstract class Activity_base extends AppCompatActivity implements Native
}
}else if(height >150){
width =(int)(height*1.78);
- }*/
+ }*//*
+
// width =690;
//height=150;
// height=height > 500 ? 500: height;
@@ -589,26 +742,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native
}
});
- //获取网盟dislike dialog,您可以在您应用中本身自定义的dislike icon 按钮中设置 mTTAdDislike.showDislikeDialog();
- /*mTTAdDislike = ad.getDislikeDialog(new TTAdDislike.DislikeInteractionCallback() {
- @Override
- public void onSelected(int position, String value) {
- TToast.show(mContext, "点击 " + value);
- }
- @Override
- public void onCancel() {
- TToast.show(mContext, "点击取消 ");
- }
- });
- if (mTTAdDislike != null) {
- XXX.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- mTTAdDislike.showDislikeDialog();
- }
- });
- } */
}
});
@@ -728,14 +862,17 @@ public abstract class Activity_base extends AppCompatActivity implements Native
toutiaoNati_Banner_AdCache.containsKey(key)?toutiaoNati_Banner_AdCache.get(key).size() :0
));
}
- /* if (!toutiaoNati_Banner_AdCache.containsKey(key)){
+ */
+/* if (!toutiaoNati_Banner_AdCache.containsKey(key)){
loadNativeBannerAd(bannerContainer, codeId, width, height);
Log.d(TAG, String.format("loadNativeBannerAd: load again ... containsKey(key) ? %s,ads size %s",toutiaoNati_Banner_AdCache.containsKey(key),
toutiaoNati_Banner_AdCache.containsKey(key)?toutiaoNati_Banner_AdCache.get(key).size() :0
));
- }*/
+ }*//*
- /* if (ads.get(0) == null || !mShowAd) {
+
+ */
+/* if (ads.get(0) == null || !mShowAd) {
return;
}
View bannerView = LayoutInflater.from(oContext).inflate(R.layout.ad_toutiao_native_ad, bannerContainer, false);
@@ -753,7 +890,8 @@ public abstract class Activity_base extends AppCompatActivity implements Native
bannerContainer.setBackgroundResource(R.color.mintcream); // @color/mintcream
Log.d(TAG, "loadBannerAd: set banner VISIBLE,mShowAd " + mShowAd);
//绑定原生广告的数据
- setAdData(bannerContainer, bannerView, ads.get(0));*/
+ setAdData(bannerContainer, bannerView, ads.get(0));*//*
+
// mTTAdNative.loadNativeAd(adSlot,null);
}
});
@@ -1047,10 +1185,12 @@ public abstract class Activity_base extends AppCompatActivity implements Native
});
}
- /**
+ */
+/**
* 加载 toutiao feed广告
- */
- public void loadListAd_toutiao(BookListAdapter adapter, int adCnt, boolean addFooter) {
+ *//*
+
+ private void loadListAd_toutiao(BookListAdapter adapter, int adCnt, boolean addFooter) {
//feed广告请求类型参数
AdSlot adSlot = new AdSlot.Builder()
.setCodeId( Constants.AD_SETTING.getInformationFlow().getSlotId(Constants.AD_TOUTIAO) )
@@ -1083,6 +1223,7 @@ public abstract class Activity_base extends AppCompatActivity implements Native
}
});
}
+*/
// qq ad ------------------------------begin
@@ -1496,6 +1637,113 @@ public abstract class Activity_base extends AppCompatActivity implements Native
}
+
+ // qq ad ------------------------------begin
+
+ private boolean qqAddFooter;
+ private BookListAdapter qqAdapter;
+ private NativeExpressAD mADManager;
+ void loadListAd_qq(BookListAdapter adapter, int adCnt, boolean addFooter) {
+ ADSize adSize = new ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT); // 消息流中用AUTO_HEIGHT
+ mADManager = new NativeExpressAD(this, adSize, getAppID(Constants.AD_TENCENT_QQ) ,
+ Constants.AD_SETTING.getInformationFlow().getSlotId(Constants.AD_TENCENT_QQ) , qqNadListiner);
+ mADManager.setMaxVideoDuration(5);
+ mADManager.loadAD(adCnt);
+ qqAdapter =adapter;
+ qqAddFooter=addFooter;
+ Log.d(TAG, "loadListAd_qq: ad requested");
+ }
+
+ class QqNadListiner implements NativeExpressAD.NativeExpressADListener{
+ @Override
+ public void onADCloseOverlay(NativeExpressADView adView) {
+ Log.i(TAG, "onADCloseOverlay");
+ }
+
+ @Override
+ public void onADLoaded(List adList) {
+ Log.i(TAG, "onADLoaded: " + adList.size());
+
+ if(qqAdapter==null){
+ return;
+ }
+
+ if(qqAddFooter) {
+ qqAdapter.AddFooterItem(adList);
+ }else{
+ qqAdapter.AddHeaderItem(adList);
+ }
+ }
+ @Override
+ public void onRenderFail(NativeExpressADView adView) {
+ Log.i(TAG, "onRenderFail: " + adView.toString());
+ }
+
+ @Override
+ public void onRenderSuccess(NativeExpressADView adView) {
+ // Log.i(TAG, "onRenderSuccess: " + adView.toString() + ", adInfo: " + getAdInfo(adView));
+ }
+
+ @Override
+ public void onADExposure(NativeExpressADView adView) {
+ Log.i(TAG, "onADExposure: " + adView.toString());
+ }
+
+ @Override
+ public void onADClicked(NativeExpressADView adView) {
+ Log.i(TAG, "onADClicked: " + adView.toString());
+ }
+
+ @Override
+ public void onADClosed(NativeExpressADView adView) {
+ Log.i(TAG, "onADClosed: " + adView.toString());
+ /* if (mAdapter != null) {
+ int removedPosition = mAdViewPositionMap.get(adView);
+ mAdapter.removeADView(removedPosition, adView);
+ }*/
+ }
+
+ @Override
+ public void onADLeftApplication(NativeExpressADView adView) {
+ Log.i(TAG, "onADLeftApplication: " + adView.toString());
+ }
+
+ @Override
+ public void onADOpenOverlay(NativeExpressADView adView) {
+ Log.i(TAG, "onADOpenOverlay: " + adView.toString());
+ }
+
+ @Override
+ public void onNoAD(AdError adError) {
+ Log.d(TAG, "loadListAd_qq: ad onNoAD " );
+ Log.i(
+ TAG,
+ String.format("onNoAD, error code: %d, error msg: %s", adError.getErrorCode(),
+ adError.getErrorMsg()));
+ }
+ }
+
+
+
+ //qq ad end<-------------
+
+ /**
+ * 加载 toutiao feed广告
+ */
+ public void loadListAd( BookListAdapter adapter, int adCnt, boolean addFooter) {
+ if(!Constants.AD_SETTING.isShowAdsense() || !Constants.AD_SETTING.getInformationFlow().isShow()){
+ return;
+ }
+ if(Constants.AD_SETTING.getInformationFlow().getSource()==Constants.AD_TENCENT_QQ) {
+ loadListAd_qq(adapter, adCnt, addFooter);
+ }else if(Constants.AD_SETTING.getInformationFlow().getSource()==Constants.AD_TOUTIAO){
+ // loadListAd_toutiao(adapter, adCnt, addFooter);
+ }
+
+ }
+
+
+
@Override
protected void onResume() {
super.onResume();
diff --git a/zhuike/src/main/java/com/novelbook/android/BookActivity.java b/zhuike/src/main/java/com/novelbook/android/BookActivity.java
index ea6b4b3..a6319c2 100644
--- a/zhuike/src/main/java/com/novelbook/android/BookActivity.java
+++ b/zhuike/src/main/java/com/novelbook/android/BookActivity.java
@@ -203,10 +203,8 @@ public class BookActivity extends Activity_base {
@Override
protected void initData() {
+ checkPermission(BookActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE, EXTERNAL_STORAGE_REQ_CODE, "添加图书需要此权限,请允许");
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- checkPermission(BookActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE, EXTERNAL_STORAGE_REQ_CODE, "添加图书需要此权限,请允许");
- }
pageFactory = PageFactory.getInstance(getApplicationContext());
// pageFactory.clear();
setBookInfo();//set title ,data from novel list
@@ -252,7 +250,7 @@ public class BookActivity extends Activity_base {
rvBooklistAuthor.setLayoutManager(new LinearLayoutManager(this));
rvBooklistAuthor.setAdapter(mAdapterAuthor);
- loadListAd_toutiao(mAdapterAuthor, 1 ,false);
+ loadListAd(mAdapterAuthor, 1 ,false);
}
private void setNovelsRelated(){
@@ -271,7 +269,7 @@ public class BookActivity extends Activity_base {
rvBooklistRelated.setLayoutManager(new LinearLayoutManager(this));
rvBooklistRelated.setAdapter(mAdapterRelated);
- loadListAd_toutiao(mAdapterRelated, 1 ,false);
+ loadListAd (mAdapterRelated, 1 ,false);
}
/**
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 904acd2..1fea403 100644
--- a/zhuike/src/main/java/com/novelbook/android/Fragments/BasicFragment.java
+++ b/zhuike/src/main/java/com/novelbook/android/Fragments/BasicFragment.java
@@ -31,19 +31,9 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
-import com.bumptech.glide.Glide;
-import com.bytedance.sdk.openadsdk.AdSlot;
-import com.bytedance.sdk.openadsdk.TTAdDislike;
-import com.bytedance.sdk.openadsdk.TTAdNative;
-import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
-import com.bytedance.sdk.openadsdk.TTBannerAd;
-import com.bytedance.sdk.openadsdk.TTFeedAd;
+
import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.novelbook.android.AD.toutiao.TToast;
+
import com.novelbook.android.Activity_base;
import com.novelbook.android.Activity_paihangbang;
@@ -95,7 +85,7 @@ import static com.novelbook.android.bean.AdSetting.getAppID;
/**
* A simple {@link Fragment} subclass.
*/
-public abstract class BasicFragment extends Fragment implements /* NativeADUnifiedListener,*/NativeExpressAD.NativeExpressADListener {
+public abstract class BasicFragment extends Fragment /*implements NativeADUnifiedListener,NativeExpressAD.NativeExpressADListener*/ {
private static String TAG = BasicFragment.class.getSimpleName();
protected View rootView;
@@ -163,7 +153,7 @@ public abstract class BasicFragment extends Fragment implements /* NativeADUnif
initData();
initViews();
initSwipeRefreshLayout();
- if (mBannerContainer!=null && !Constants.AD_SETTING.isShowAdsense()) {
+ if (mBannerContainer!=null && (!Constants.AD_SETTING.isShowAdsense() || !Constants.AD_SETTING.getFixBanner().isShow() )) {
if( mBannerContainer.getVisibility() !=View.GONE) {
mBannerContainer.setVisibility(View.GONE);
}
@@ -480,147 +470,8 @@ void initTabs(){
if( mBannerContainer.getVisibility() !=View.VISIBLE)
mBannerContainer.setVisibility(View.VISIBLE);
}
-
- // qq ad ------------------------------begin
- /* private NativeUnifiedAD mAdManager;
- private List mAds = new ArrayList<>();
- public void loadListAd_qq(BookListAdapter adapter, int adCnt, boolean addFooter) {
- if(mAdManager==null) {
- mAdManager = new NativeUnifiedAD(activity,
- getAppID(Constants.AD_TENCENT_QQ),
- Constants.AD_SETTING.getInformationFlow().getSlotId(Constants.AD_TENCENT_QQ),
- this);
- }
- mAdManager.loadData(adCnt);
- qqAdapter =adapter;
- qqAddFooter=addFooter;
- Log.d(TAG, "loadListAd_qq: ad requested");
- }*/
-
-
- private boolean qqAddFooter;
- private BookListAdapter qqAdapter;
-/* @Override
- public void onADLoaded(List ads) {
- Log.d(TAG, "loadListAd_qq: ad onADLoaded,qqAddFooter? "+qqAddFooter);
- // mIsLoading = false;
- // 防止在onDestory后网络回包
- if(qqAdapter==null){
- return;
- }
-
- if(qqAddFooter) {
- qqAdapter.AddFooterItem(ads);
- }else{
- qqAdapter.AddHeaderItem(ads);
- }
- }*/
- @Override
- public void onNoAD(AdError adError) {
- Log.d(TAG, "loadListAd_qq: ad onNoAD " );
- Log.i(
- TAG,
- String.format("onNoAD, error code: %d, error msg: %s", adError.getErrorCode(),
- adError.getErrorMsg()));
- }
-
- private NativeExpressAD mADManager;
- void loadListAd_qq(BookListAdapter adapter, int adCnt, boolean addFooter) {
- ADSize adSize = new ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT); // 消息流中用AUTO_HEIGHT
- mADManager = new NativeExpressAD(activity, adSize, getAppID(Constants.AD_TENCENT_QQ) ,
- Constants.AD_SETTING.getInformationFlow().getSlotId(Constants.AD_TENCENT_QQ) , this);
- mADManager.setMaxVideoDuration(5);
- mADManager.loadAD(adCnt);
- qqAdapter =adapter;
- qqAddFooter=addFooter;
- Log.d(TAG, "loadListAd_qq: ad requested");
- }
- @Override
- public void onADLoaded(List adList) {
- Log.i(TAG, "onADLoaded: " + adList.size());
- /* mAdViewList = adList;
- for (int i = 0; i < mAdViewList.size(); i++) {
- int position = FIRST_AD_POSITION + ITEMS_PER_AD * i;
- if (position < mNormalDataList.size()) {
- NativeExpressADView view = mAdViewList.get(i);
- GDTLogger.i("ad load[" + i + "]: " + getAdInfo(view));
- if (view.getBoundData().getAdPatternType() == AdPatternType.NATIVE_VIDEO) {
- view.setMediaListener(mediaListener);
- }
- mAdViewPositionMap.put(view, position); // 把每个广告在列表中位置记录下来
- mAdapter.addADViewToPosition(position, mAdViewList.get(i));
- }
- }
- mAdapter.notifyDataSetChanged();*/
- if(qqAdapter==null){
- return;
- }
-
- if(qqAddFooter) {
- qqAdapter.AddFooterItem(adList);
- }else{
- qqAdapter.AddHeaderItem(adList);
- }
- }
- @Override
- public void onRenderFail(NativeExpressADView adView) {
- Log.i(TAG, "onRenderFail: " + adView.toString());
- }
-
- @Override
- public void onRenderSuccess(NativeExpressADView adView) {
- // Log.i(TAG, "onRenderSuccess: " + adView.toString() + ", adInfo: " + getAdInfo(adView));
- }
-
- @Override
- public void onADExposure(NativeExpressADView adView) {
- Log.i(TAG, "onADExposure: " + adView.toString());
- }
-
- @Override
- public void onADClicked(NativeExpressADView adView) {
- Log.i(TAG, "onADClicked: " + adView.toString());
- }
-
- @Override
- public void onADClosed(NativeExpressADView adView) {
- Log.i(TAG, "onADClosed: " + adView.toString());
- /* if (mAdapter != null) {
- int removedPosition = mAdViewPositionMap.get(adView);
- mAdapter.removeADView(removedPosition, adView);
- }*/
- }
-
- @Override
- public void onADLeftApplication(NativeExpressADView adView) {
- Log.i(TAG, "onADLeftApplication: " + adView.toString());
- }
-
- @Override
- public void onADOpenOverlay(NativeExpressADView adView) {
- Log.i(TAG, "onADOpenOverlay: " + adView.toString());
- }
-
- @Override
- public void onADCloseOverlay(NativeExpressADView adView) {
- Log.i(TAG, "onADCloseOverlay");
- }
-
- //qq ad end<-------------
-
- /**
- * 加载 toutiao feed广告
- */
- void loadListAd( BookListAdapter adapter, int adCnt, boolean addFooter) {
- if(!Constants.AD_SETTING.isShowAdsense()){
- return;
- }
- if(Constants.AD_SETTING.getInformationFlow().getSource()==Constants.AD_TENCENT_QQ) {
- loadListAd_qq(adapter, adCnt, addFooter);
- }else if(Constants.AD_SETTING.getInformationFlow().getSource()==Constants.AD_TOUTIAO){
- activity.loadListAd_toutiao(adapter, adCnt, addFooter);
- }
-
+ void loadListAd( BookListAdapter adapter, int adCnt, boolean addFooter) {
+ activity.loadListAd(adapter,adCnt,addFooter);
}
@Override
diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_Shelf.java b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_Shelf.java
index 6260175..f61a01d 100644
--- a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_Shelf.java
+++ b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_Shelf.java
@@ -13,6 +13,7 @@ import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.util.Log;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -25,9 +26,9 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
-import com.androidquery.callback.AQuery2;
+/*import com.androidquery.callback.AQuery2;
import com.novelbook.android.AD.toutiao.TTAdManagerHolder;
-import com.novelbook.android.BuildConfig;
+import com.novelbook.android.BuildConfig;*/
import com.novelbook.android.Main2Activity;
import com.novelbook.android.R;
import com.novelbook.android.db.Chapter;
@@ -111,11 +112,11 @@ public class Fragment_Shelf extends BasicFragment {
,Fileutil.formatFileSize( LitePal.getDatabase().getMaximumSize())
));
- try{
+ /* try{
throw new Exception("show trace");
}catch (Exception e){
Log.e(TAG, "loadNovelsOnShelf: ",e);
- }
+ }*/
bookLists = Novel.getNovelsOnShelf();
noveIds = "";
diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_booklist.java b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_booklist.java
index 5d5b188..9bbd78e 100644
--- a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_booklist.java
+++ b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_booklist.java
@@ -1,7 +1,7 @@
package com.novelbook.android.Fragments;
import android.annotation.SuppressLint;
-import android.content.Intent;
+
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@@ -12,22 +12,8 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
-import com.bytedance.sdk.openadsdk.AdSlot;
-import com.bytedance.sdk.openadsdk.TTAdNative;
-import com.bytedance.sdk.openadsdk.TTFeedAd;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.novelbook.android.AD.toutiao.TToast;
-import com.novelbook.android.Activity_Search;
-import com.novelbook.android.Activity_base;
-import com.novelbook.android.BuildConfig;
-import com.novelbook.android.Main2Activity;
import com.novelbook.android.R;
-import com.novelbook.android.activity_cates;
-import com.novelbook.android.adapter.BandanAdapterNew;
-import com.novelbook.android.bean.NovelBlock;
+
import com.novelbook.android.db.Novel;
import com.novelbook.android.netsubscribe.BookSubscribe;
import com.novelbook.android.netutils.OnSuccessAndFaultListener;
@@ -39,11 +25,9 @@ import com.novelbook.android.adapter.BookListAdapter;
import com.umeng.analytics.MobclickAgent;
import org.json.JSONObject;
-import org.litepal.LitePal;
-import java.nio.file.Path;
import java.util.ArrayList;
-import java.util.Iterator;
+
import java.util.List;
import butterknife.BindView;
diff --git a/zhuike/src/main/java/com/novelbook/android/Main2Activity.java b/zhuike/src/main/java/com/novelbook/android/Main2Activity.java
index 73530e2..8f92644 100644
--- a/zhuike/src/main/java/com/novelbook/android/Main2Activity.java
+++ b/zhuike/src/main/java/com/novelbook/android/Main2Activity.java
@@ -98,7 +98,7 @@ public class Main2Activity extends Activity_base
// requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
config =Config.getInstance();
// ButterKnife.bind(this);
-
+ CommonUtil.checkPermission(this, Manifest.permission.INSTALL_PACKAGES, 1000, "下载更新需要此权限,请允许");
initialSexOption();
//checkUpdate(true);
CommonUtil.getSearchTabTtitle(this);
@@ -432,6 +432,11 @@ private int bottomSelectedIndex;
return true;
}
+ if(isShelfZhengli){
+ udateShelfZhengli();
+ return true;
+ }
+
int cnt=0;
long secondTime = System.currentTimeMillis();
if (secondTime - firstTime > 800) {//如果两次按键时间间隔大于800毫秒,则不退出
@@ -488,7 +493,7 @@ private int bottomSelectedIndex;
private void setSexOption(){
int s = rgSex.getCheckedRadioButtonId() == R.id.radioButtonBoy ?1:2;
if(s!= Constants.SEX){
- TTAdManagerHolder.initOnSexChange(MyApp.applicationContext);
+ TTAdManagerHolder.initOnSexChange(MyApp.applicationContext);
Constants.SEX=s;
config.setSexOption(s);
Fragment current = getSupportFragmentManager().findFragmentById(R.id.realtabcontent);
diff --git a/zhuike/src/main/java/com/novelbook/android/MarkActivity.java b/zhuike/src/main/java/com/novelbook/android/MarkActivity.java
index 912c68d..b6d9a70 100644
--- a/zhuike/src/main/java/com/novelbook/android/MarkActivity.java
+++ b/zhuike/src/main/java/com/novelbook/android/MarkActivity.java
@@ -5,6 +5,7 @@ import android.graphics.Typeface;
import android.support.design.widget.AppBarLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
+import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Menu;
@@ -103,8 +104,9 @@ TextView tvSource;
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(pageFactory.getBookName());
}
- tvSource.setText(String.format("以下目录及内容来自%s%s",pageFactory.getSite().getName(), Constants.SHOW_NOVEL_CHAPTER_URL ? pageFactory.getSite().getMuluUrl():""));
-
+ if(!TextUtils.isEmpty(pageFactory.getSite().getName())) {
+ tvSource.setText(String.format("以下目录及内容来自%s%s", pageFactory.getSite().getName(), Constants.SHOW_NOVEL_CHAPTER_URL ? pageFactory.getSite().getMuluUrl() : ""));
+ }
pager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(),pageFactory.getNovle().getId()));
tabLayout.setViewPager(pager);
}
diff --git a/zhuike/src/main/java/com/novelbook/android/MyApp.java b/zhuike/src/main/java/com/novelbook/android/MyApp.java
index 037c94f..1429f6b 100644
--- a/zhuike/src/main/java/com/novelbook/android/MyApp.java
+++ b/zhuike/src/main/java/com/novelbook/android/MyApp.java
@@ -5,10 +5,10 @@ import android.app.Application;
import android.content.Context;
import android.provider.SyncStateContract;
import android.util.Log;
-
+/*
import com.bytedance.sdk.openadsdk.TTAdConfig;
import com.bytedance.sdk.openadsdk.TTAdConstant;
-import com.bytedance.sdk.openadsdk.TTAdSdk;
+import com.bytedance.sdk.openadsdk.TTAdSdk;*/
import com.google.android.gms.ads.MobileAds;
import com.google.gson.Gson;
import com.novelbook.android.AD.toutiao.TTAdManagerHolder;
@@ -71,7 +71,7 @@ public class MyApp extends Application {
initAD_AdMob();
}
private void initAD_ChuanShanJia(){
- TTAdManagerHolder.init(applicationContext);
+ // TTAdManagerHolder.init(applicationContext);
}
private void initAD_AdMob(){
if(AdSetting.getAppID(Constants.AD_MOB).length()>0){
@@ -92,15 +92,15 @@ public class MyApp extends Application {
/**
* 添加Activity
*/
- public void addActivity_(Activity activity) {
+ public void addActivity_(Activity_base activity) {
// 判断当前集合中不存在该Activity
if (!oList.contains(activity)) {
oList.add(activity);//把当前Activity添加到集合中
}
currentAct=activity;
}
- private static Activity currentAct =null;
- public static Activity getCurrentActivity(){
+ private static Activity_base currentAct =null;
+ public static Activity_base getCurrentActivity(){
return currentAct;
}
diff --git a/zhuike/src/main/java/com/novelbook/android/ReadActivity.java b/zhuike/src/main/java/com/novelbook/android/ReadActivity.java
index 66e9c88..442e356 100644
--- a/zhuike/src/main/java/com/novelbook/android/ReadActivity.java
+++ b/zhuike/src/main/java/com/novelbook/android/ReadActivity.java
@@ -43,7 +43,7 @@ import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
-import com.androidquery.callback.AQuery2;
+/*import com.androidquery.callback.AQuery2;
import com.androidquery.callback.ImageOptions;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdConstant;
@@ -52,7 +52,7 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
import com.bytedance.sdk.openadsdk.TTBannerAd;
import com.bytedance.sdk.openadsdk.TTImage;
-import com.bytedance.sdk.openadsdk.TTNativeAd;
+import com.bytedance.sdk.openadsdk.TTNativeAd;*/
import com.novelbook.android.AD.SplashAdManager;
import com.novelbook.android.AD.toutiao.TTAdManagerHolder;
import com.novelbook.android.AD.toutiao.TToast;
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 b882525..101a222 100644
--- a/zhuike/src/main/java/com/novelbook/android/adapter/BookListAdapter.java
+++ b/zhuike/src/main/java/com/novelbook/android/adapter/BookListAdapter.java
@@ -19,16 +19,16 @@ import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
-import com.androidquery.callback.AQuery2;
+//import com.androidquery.callback.AQuery2;
import com.androidquery.callback.ImageOptions;
-import com.bytedance.sdk.openadsdk.DownloadStatusController;
+/*import com.bytedance.sdk.openadsdk.DownloadStatusController;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAppDownloadListener;
import com.bytedance.sdk.openadsdk.TTFeedAd;
import com.bytedance.sdk.openadsdk.TTImage;
import com.bytedance.sdk.openadsdk.TTNativeAd;
import com.novelbook.android.AD.toutiao.TToast;
-import com.novelbook.android.BookActivity;
+import com.novelbook.android.BookActivity;*/
import com.novelbook.android.R;
import com.novelbook.android.db.Novel;
@@ -106,8 +106,8 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
this.percent = percent;
}
- private AQuery2 mAQuery;
- private Map mTTAppDownloadListenerMap = new WeakHashMap<>();
+// private AQuery2 mAQuery;
+// private Map mTTAppDownloadListenerMap = new WeakHashMap<>();
public void setShowFootView(boolean showFootView) {
this.showFootView = showFootView;
}
@@ -116,7 +116,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
mContext = context;
mInflater = LayoutInflater.from(mContext);
mDatas = datas;
- this.mAQuery = new AQuery2(context);
+// this.mAQuery = new AQuery2(context);
}
public BookListAdapter(Context context, List mBooks, int listItemID, OnItemClickListener clickLitener) {
@@ -125,7 +125,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
this.mOnItemClickListener = clickLitener;
this.listItemID = listItemID;
mInflater = LayoutInflater.from(mContext);
- this.mAQuery = new AQuery2(context);
+// this.mAQuery = new AQuery2(context);
}
@@ -133,7 +133,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
public BookListAdapter(Context context, OnItemClickListener clickLitener) {
this.mContext = context;
this.mOnItemClickListener = clickLitener;
- this.mAQuery = new AQuery2(context);
+// this.mAQuery = new AQuery2(context);
}
public void setListener(OnItemClickListener clickLitener){
@@ -150,7 +150,8 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
//最后一个item设置为footerView
if (mDatas.get(position) instanceof Novel) {
return TYPE_ITEM;
- } else if (mDatas.get(position) instanceof TTFeedAd) {
+ }
+ /* else if (mDatas.get(position) instanceof TTFeedAd) {
TTFeedAd ad = (TTFeedAd) mDatas.get(position);
Log.d(TAG, "getItemViewType: ad.getImageMode()= " +ad.getImageMode());
if (ad.getImageMode() == TTAdConstant.IMAGE_MODE_SMALL_IMG) {
@@ -163,7 +164,8 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
return ITEM_VIEW_TYPE_VIDEO;
}
return ITEM_VIEW_TYPE_SMALL_PIC_AD;
- }else if(mDatas.get(position) instanceof NativeExpressADView ){
+ }*/
+ else if(mDatas.get(position) instanceof NativeExpressADView ){
return ITEM_VIEW_TYPE_QQ_NATIVE_EXPRESS;
}
Log.d(TAG, String.format("getItemViewType exception 1: position %s, mDatas.get(position) %s ,mDatas.size %s",position, mDatas.get(position),mDatas.size() ));
@@ -232,7 +234,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
@Override
public void onBindViewHolder(RecyclerView.ViewHolder hd, int position) {
- TTFeedAd ttFeedAd;
+ // TTFeedAd ttFeedAd;
if (hd instanceof FooterViewHolder) {
@@ -368,7 +370,8 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
}
});
}
- }else if (hd instanceof SmallAdViewHolder) {
+ }
+ /* else if (hd instanceof SmallAdViewHolder) {
ttFeedAd =(TTFeedAd) mDatas.get(position);
SmallAdViewHolder smallAdViewHolder = (SmallAdViewHolder) hd;
bindData(smallAdViewHolder, ttFeedAd);
@@ -449,7 +452,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
}
}
- }
+ }*/
}
@Override
@@ -501,10 +504,14 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
}
}
public void AddHeaderItem(List items) {
- if(mDatas.size()>3 &&( mDatas.get(3) instanceof TTFeedAd) ){
+ if(mDatas.size()>3 &&( mDatas.get(3) instanceof NativeExpressADView
+ /*|| mDatas.get(3) instanceof TTFeedAd*/) ){
return;
}
int p = mDatas.size()>3?3:0;
+ if( mDatas.get(p) instanceof NativeExpressADView){
+ return;
+ }
mDatas.addAll(p, items);
notifyDataSetChanged();
}
@@ -666,7 +673,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
}
}
-
+/*
private void bindData(final AdViewHolder adViewHolder, TTFeedAd ad) {
//可以被点击的view, 也可以把convertView放进来意味item可被点击
List clickViewList = new ArrayList<>();
@@ -745,7 +752,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
private void bindDownLoadStatusController(AdViewHolder adViewHolder, final TTFeedAd ad) {
final DownloadStatusController controller = ad.getDownloadStatusController();
- /* adViewHolder.mStopButton.setOnClickListener(new View.OnClickListener() {
+ *//* adViewHolder.mStopButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (controller != null) {
@@ -765,7 +772,7 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
Log.d(TAG, "取消下载");
}
}
- });*/
+ });*//*
}
private void bindDownloadListener(final Button adCreativeButton, final AdViewHolder adViewHolder, TTFeedAd ad) {
@@ -842,6 +849,6 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
//一个ViewHolder对应一个downloadListener, isValid判断当前ViewHolder绑定的listener是不是自己
ad.setDownloadListener(downloadListener); // 注册下载监听器
mTTAppDownloadListenerMap.put(adViewHolder, downloadListener);
- }
+ }*/
}
diff --git a/zhuike/src/main/java/com/novelbook/android/netapi/HttpApi.java b/zhuike/src/main/java/com/novelbook/android/netapi/HttpApi.java
index 90b4bbe..3f6843e 100644
--- a/zhuike/src/main/java/com/novelbook/android/netapi/HttpApi.java
+++ b/zhuike/src/main/java/com/novelbook/android/netapi/HttpApi.java
@@ -7,6 +7,8 @@ import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
+import retrofit2.http.FieldMap;
+import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
@@ -100,5 +102,8 @@ public interface HttpApi {
Observable getPaihangBangByCate(@Query("sex") int Sex,@Query("cid") int cid);
@GET("page/siterank")
Observable getPaihangBangList(@Query("sex") int Sex,@Query("cid") int cid,@Query("pn")int pageNo);
+ @FormUrlEncoded
+ @POST("r/{actionType}.shtml") //{action type}.shtml?msg=${msg}
+ Observable reportMsg(@Path("actionType")String actionType, @FieldMap Map map);
}
diff --git a/zhuike/src/main/java/com/novelbook/android/netsubscribe/BookSubscribe.java b/zhuike/src/main/java/com/novelbook/android/netsubscribe/BookSubscribe.java
index 2569267..687b1cd 100644
--- a/zhuike/src/main/java/com/novelbook/android/netsubscribe/BookSubscribe.java
+++ b/zhuike/src/main/java/com/novelbook/android/netsubscribe/BookSubscribe.java
@@ -1,6 +1,10 @@
package com.novelbook.android.netsubscribe;
+import android.util.Log;
+
import com.novelbook.android.netutils.HttpMethods;
+import com.novelbook.android.netutils.OnSuccessAndFaultListener;
+import com.novelbook.android.netutils.OnSuccessAndFaultSub;
import java.util.HashMap;
import java.util.Map;
@@ -8,8 +12,10 @@ import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.observers.DisposableObserver;
import okhttp3.ResponseBody;
+import retrofit2.http.Path;
public class BookSubscribe {
+ public final static String TAG = BookSubscribe.class.getSimpleName();
public static void getData(int pageNumber, int count, DisposableObserver subscriber) {
Map map = new HashMap<>();
map.put("start",pageNumber);
@@ -104,4 +110,25 @@ public class BookSubscribe {
Observable observable = HttpMethods.getInstance("page/siterank").getHttpApi().getPaihangBangList(sex,cid,pageNo);
HttpMethods.getInstance().toSubscribe(observable, subscriber);
}
+
+ public static void reportMsg(String actionType, String msg ){
+ Map map = new HashMap<>();
+ map.put("msg",msg );
+
+ Observable observable = HttpMethods.getInstance("r/").getHttpApi().reportMsg( actionType, map);
+ Log.d( TAG,String.format("report actionType %s, msg %s",actionType,msg));
+ DisposableObserver subscriber = new OnSuccessAndFaultSub(new OnSuccessAndFaultListener() {
+
+ @Override
+ public void onSuccess(String result) {
+ Log.d( TAG,String.format("report result %s",result));
+ }
+
+ @Override
+ public void onFault(String errorMsg) {
+ Log.e( TAG,String.format("report error %s",errorMsg));
+ }
+ });
+ HttpMethods.getInstance().toSubscribe(observable, subscriber);
+ }
}
diff --git a/zhuike/src/main/java/com/novelbook/android/netutils/NetUtil.java b/zhuike/src/main/java/com/novelbook/android/netutils/NetUtil.java
index 3e4aff3..727fcf2 100644
--- a/zhuike/src/main/java/com/novelbook/android/netutils/NetUtil.java
+++ b/zhuike/src/main/java/com/novelbook/android/netutils/NetUtil.java
@@ -12,6 +12,7 @@ import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.novelbook.android.AD.toutiao.TTAdManagerHolder;
+import com.novelbook.android.Activity_base;
import com.novelbook.android.BookActivity;
import com.novelbook.android.BuildConfig;
import com.novelbook.android.Main2Activity;
@@ -447,7 +448,7 @@ public class NetUtil {
}
public static void checkUpdate(boolean isSilence){
- Activity currentActivity = MyApp.getCurrentActivity();
+ Activity_base currentActivity = MyApp.getCurrentActivity();
if(currentActivity==null){
return;
}
diff --git a/zhuike/src/main/java/com/novelbook/android/permision/RuntimeRationale.java b/zhuike/src/main/java/com/novelbook/android/permision/RuntimeRationale.java
new file mode 100644
index 0000000..cad4af1
--- /dev/null
+++ b/zhuike/src/main/java/com/novelbook/android/permision/RuntimeRationale.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright © Zhenjie Yan
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *//*
+
+package com.novelbook.android.permision;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.text.TextUtils;
+
+import com.novelbook.android.R;
+*/
+/*import com.yanzhenjie.permission.Permission;
+import com.yanzhenjie.permission.Rationale;
+import com.yanzhenjie.permission.RequestExecutor;*//*
+
+
+import java.util.List;
+
+*/
+/**
+ * Created by Zhenjie Yan on 2018/1/1.
+ *//*
+
+public final class RuntimeRationale implements Rationale> {
+
+ @Override
+ public void showRationale(Context context, List permissions, final RequestExecutor executor) {
+ List permissionNames = Permission.transformText(context, permissions);
+ String message = context.getString(R.string.message_permission_rationale,
+ TextUtils.join("\n", permissionNames));
+
+ new AlertDialog.Builder(context).setCancelable(false)
+ .setTitle(R.string.title_dialog)
+ .setMessage(message)
+ .setPositiveButton(R.string.resume, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ executor.execute();
+ }
+ })
+ .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ executor.cancel();
+ }
+ })
+ .show();
+ }
+}*/
diff --git a/zhuike/src/main/java/com/novelbook/android/upgrade/UpdateManager.java b/zhuike/src/main/java/com/novelbook/android/upgrade/UpdateManager.java
index c39e944..8ce4faf 100644
--- a/zhuike/src/main/java/com/novelbook/android/upgrade/UpdateManager.java
+++ b/zhuike/src/main/java/com/novelbook/android/upgrade/UpdateManager.java
@@ -34,6 +34,7 @@ import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;
+import com.novelbook.android.Activity_base;
import com.novelbook.android.BookActivity;
import com.novelbook.android.BuildConfig;
import com.novelbook.android.MyApp;
@@ -71,7 +72,7 @@ public class UpdateManager {
private String mSavePath;
private int progress;
private boolean cancelUpdate = false;
- private Activity mContext;
+ private Activity_base mContext;
private ProgressBar mProgress;
private Dialog mDownloadDialog;
private boolean isForceRefresh;
@@ -98,7 +99,7 @@ public class UpdateManager {
};
};
- public UpdateManager(Activity context)
+ public UpdateManager(Activity_base context)
{
this.mContext = context;
// app =(QiYouApplication)context;
@@ -214,7 +215,7 @@ public class UpdateManager {
}
}
- if (isUpdate)
+ if (isUpdate )
{
mHandler.sendEmptyMessage(showDialog);
@@ -320,6 +321,7 @@ public class UpdateManager {
{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
CommonUtil.checkPermission(mContext, Manifest.permission.WRITE_EXTERNAL_STORAGE, EXTERNAL_STORAGE_REQ_CODE, "下载更新需要此权限,请允许");
+ CommonUtil.checkPermission(mContext, Manifest.permission.INSTALL_PACKAGES, 1024, "下载更新需要此权限,请允许");
}
// 閺嬪嫰锟界�纭呯樈濡楋拷
@@ -357,6 +359,7 @@ public class UpdateManager {
}
});
Dialog noticeDialog = builder.create();
+ noticeDialog.setCancelable(false);
noticeDialog.show();
@@ -390,7 +393,7 @@ public class UpdateManager {
}
});
mDownloadDialog = builder.create();
- mDownloadDialog.setCancelable(false);
+ mDownloadDialog.setCancelable(true);
mDownloadDialog.show();
// 閻滄澘婀弬鍥︽
downloadApk();
@@ -465,9 +468,16 @@ public class UpdateManager {
}
} catch (MalformedURLException e)
{
+ if(isForceRefresh){
+ exit(-1);
+ }
Log.e(TAG, "run: ", e);
} catch (IOException e)
{
+ mContext.checkAndRequestPermission();
+ if(isForceRefresh){
+ // exit(-1);
+ }
Log.e(TAG, "run: ", e);
}
// 閸欐牗绉锋稉瀣祰鐎电鐦藉鍡樻▔缁�拷
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 2088507..b1ce6ff 100644
--- a/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java
+++ b/zhuike/src/main/java/com/novelbook/android/utils/BookUtil.java
@@ -15,6 +15,7 @@ import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.Gson;
+import com.novelbook.android.BuildConfig;
import com.novelbook.android.MyApp;
import com.novelbook.android.bean.Cache;
import com.novelbook.android.bean.NovelSites;
@@ -32,6 +33,7 @@ import com.novelbook.android.netutils.OnSuccessAndFaultSub;
import org.json.JSONException;
import org.json.JSONObject;
import org.litepal.LitePal;
+import org.litepal.util.Const;
import org.w3c.dom.Text;
import java.io.File;
@@ -439,13 +441,30 @@ public class BookUtil {
}
+ void reportMsg(String reportType,String url,String content,String headers,String httpStatus){
+
+ String msg = String.format("{\"type\":%s, \"id\":%s ,\"name\":\"%s\",\"site\":\"%s\",\"url\":\"%s\",\"content\":\"%s\",\"requestHeader\":\"%s\",\"httpStatus\":\"%s\"}," ,
+ reportType ,mNovel.getId(),mNovel.getName(),mSite.getDomain(),url ,content,headers,httpStatus);
+
+ msg = String.format("{\"type\":%s, \"novelId\":%s ,\"site\":\"%s\",\"url\":\"%s\",\"httpStatus\":\"%s\",\"content\":\"%s\"}," ,
+ reportType ,mNovel.getNovelId(),mSite.getDomain(),url ,httpStatus,content);
+
+ BookSubscribe.reportMsg(reportType ,msg);
+ }
private void checkLastUpdatedChapter() {
+ if(BuildConfig.LOG_DEBUG) {
+ if(mChapters.size()>1) {
+ reportMsg(Constants.REPORT_NEW_UPDATE, mChapters.get(mChapters.size() - 1).getChapterUrl(), mNovel.getChapterName(), "", "");
+ }
+ }
for (int i=mChapters.size()-1;i>0;i--) {
if(mChapters.get(i).getChapterName().equals(mNovel.getChapterName())){
if(i 0) {
builder.header("Cache-Control", "public, max-age=" + maxAge);
}
-
-
-
return builder.build();
}
+ private String getRequestHeader(Request request) {
+
+ String head = String.format("\"Referer\":\"%s\",\"User-Agent\":\"%s\",\"Cache-Control\":\"%s\"",
+ request.header("Referer"),request.header("User-Agent"), request.header("Cache-Control")
+ );
+
+
+ for (int i = 0; i < mSiteRule.getHeaders().length; i += 2) {
+
+ head += String.format(",\"%s\":\"%s\"",mSiteRule.getHeaders()[i], mSiteRule.getHeaders()[i + 1]) ;
+
+ }
+
+ return "{" + head +"}";
+
+ }
+
public boolean isChapterTitle(String line){
return (line.length() <= 30 && (line.matches(".*第.{1,8}章.*") || line.matches(".*第.{1,8}节.*"))) ;
diff --git a/zhuike/src/main/java/com/novelbook/android/utils/CommonUtil.java b/zhuike/src/main/java/com/novelbook/android/utils/CommonUtil.java
index bf8b471..cf596d3 100644
--- a/zhuike/src/main/java/com/novelbook/android/utils/CommonUtil.java
+++ b/zhuike/src/main/java/com/novelbook/android/utils/CommonUtil.java
@@ -1,13 +1,18 @@
package com.novelbook.android.utils;
+import android.Manifest;
+import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
+import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Point;
+import android.net.Uri;
import android.os.Build;
+import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.ContentLoadingProgressBar;
@@ -27,6 +32,7 @@ import android.widget.Toast;
import com.novelbook.android.netsubscribe.BookSubscribe;
import com.novelbook.android.netutils.OnSuccessAndFaultListener;
import com.novelbook.android.netutils.OnSuccessAndFaultSub;
+//import com.yanzhenjie.permission.AndPermission;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -338,6 +344,7 @@ public class CommonUtil {
return 0;
}
}
+
public static int getVersionCodeLong(Context context) {
if(Constants.version >0){
return Constants.version;
@@ -345,7 +352,9 @@ public class CommonUtil {
try {
PackageManager manager = context.getPackageManager();
PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
- Constants.version = (int) info.getLongVersionCode();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
+ Constants.version = (int) info.getLongVersionCode();
+ }else return getVersionCode(context);
} catch (Exception e) {
e.printStackTrace();
return 0;
@@ -525,10 +534,20 @@ public class CommonUtil {
}
public static void checkPermission (Activity thisActivity, String permission, int requestCode, String errorText) {
//判断当前Activity是否已经获得了该权限
- if(ContextCompat.checkSelfPermission(thisActivity,permission) != PackageManager.PERMISSION_GRANTED) {
+ boolean hasPermision =true;
+ try{
+ hasPermision = ContextCompat.checkSelfPermission(thisActivity,permission) == PackageManager.PERMISSION_GRANTED;
+ }catch (Exception e){
+
+ }
+ Log.e(TAG, String.format("checkAndRequestPermission: %s 有权限? ",hasPermision) );
+ if(!hasPermision) {
+ Log.e(TAG, String.format("checkAndRequestPermission: %s 曾经被用户拒绝过? %s",permission,ActivityCompat.shouldShowRequestPermissionRationale(thisActivity,
+ permission)) );
//如果App的权限申请曾经被用户拒绝过,就需要在这里跟用户做出解释
if (ActivityCompat.shouldShowRequestPermissionRationale(thisActivity,
permission)) {
+
Toast.makeText(thisActivity,errorText,Toast.LENGTH_SHORT).show();
//进行权限请求
ActivityCompat.requestPermissions(thisActivity,
@@ -536,15 +555,61 @@ public class CommonUtil {
requestCode);
} else {
//进行权限请求
- ActivityCompat.requestPermissions(thisActivity,
- new String[]{permission},
- requestCode);
+ Log.e(TAG, String.format("checkAndRequestPermission: %s start requestperimisions ",permission ) );
+ // startAppSettingActivity(thisActivity);
+ ActivityCompat.requestPermissions(thisActivity, new String[]{permission}, requestCode);
}
} else {
}
}
+ private static boolean isSDK2API23() {
+ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
+ }
+ private static boolean isHavePermission(Context context, String permission) {
+ return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(context, permission);
+ }
+
+ private static boolean isUserNoShowPermissionDialig(Activity activity, String permission) {
+ return !(ActivityCompat.shouldShowRequestPermissionRationale(activity, permission));
+ }
+
+ private static void startAppSettingActivity(Activity activity) {
+ Intent intent = new Intent();
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+ intent.setData(Uri.parse("package:" + activity.getPackageName()));
+
+ intent.addCategory(Intent.CATEGORY_DEFAULT);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
+ intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
+ activity.startActivityForResult(intent, 100);
+ }
+
+
+ /*private void requestPermission(Activity thisActivity,String permission) {
+ AndPermission.with(thisActivity).runtime()
+ .permission(permission)
+ // 准备方法,和 okhttp 的拦截器一样,在请求权限之前先运行改方法,已经拥有权限不会触发该方法
+ .rationale((context, permissions, executor) -> {
+ // 此处可以选择显示提示弹窗
+ executor.execute();
+ })
+ // 用户给权限了
+
+ // 用户拒绝权限,包括不再显示权限弹窗也在此列
+ .onDenied(permissions -> {
+ // 判断用户是不是不再显示权限弹窗了,若不再显示的话进入权限设置页
+ if (AndPermission.hasAlwaysDeniedPermission(thisActivity, permissions)) {
+ // 打开权限设置页
+ // AndPermission.with(thisActivity).permissionSetting(thisActivity).execute();
+ return;
+ }
+
+ })
+ .start();
+ }*/
public static void getSearchTabTtitle(Context context){
BookSubscribe.getSearchTitles(Constants.SEX,new OnSuccessAndFaultSub(new OnSuccessAndFaultListener() {
diff --git a/zhuike/src/main/java/com/novelbook/android/utils/Config.java b/zhuike/src/main/java/com/novelbook/android/utils/Config.java
index d780b57..60e61e1 100644
--- a/zhuike/src/main/java/com/novelbook/android/utils/Config.java
+++ b/zhuike/src/main/java/com/novelbook/android/utils/Config.java
@@ -209,7 +209,7 @@ public class Config {
//String defaultHost =CommonUtil.getMeta(MyApp.applicationContext,"MAINHOST");
String defaultHost = BuildConfig.MAIN_HOST;
- String rt =sp.getString(KEY_ROOT_URL,defaultHost);
+ // String rt =sp.getString(KEY_ROOT_URL,defaultHost);
return sp.getString(KEY_ROOT_URL,defaultHost);
}
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 86fdaa8..e1031ba 100644
--- a/zhuike/src/main/java/com/novelbook/android/utils/Constants.java
+++ b/zhuike/src/main/java/com/novelbook/android/utils/Constants.java
@@ -18,8 +18,9 @@ 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_MOB =2;
+ public static final int AD_TOUTIAO =3;
+
public static final int AD_BANNER_TOP =1;
public static final int AD_BANNER_BOTTOM =2;
@@ -75,5 +76,11 @@ public class Constants {
public final static int MAX_SLEEP_4_CHAPT_DOWNLOAD =10000;//最多等待时间10s
public final static int MAX_SHELF_CNT =100;
+ public static final String REPORT_NEW_UPDATE ="HasNewUpdate"; //其它源有新章节
+ public static final String REPORT_REX_CHAPTER_CONTENT_ERROR ="EmptyText";//章节内容解析错误
+ public static final String REPORT_REX_MULU_ERROR ="NovelNotFound";//目录获取错误 ,或书不存在
+
+
+
}
diff --git a/zhuike/src/main/res/drawable-v21/toutiao_splash_banner.png b/zhuike/src/main/res/drawable-v21/toutiao_splash_banner.png
deleted file mode 100644
index 71d1c7e73edcdf9a919dfb207fa2c799205605ec..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 4590
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
GcmD$b2-V&I
diff --git a/zhuike/src/main/res/layout/ad_qq_activity_splash.xml b/zhuike/src/main/res/layout/ad_qq_activity_splash.xml
index e2e90ab..98e3609 100644
--- a/zhuike/src/main/res/layout/ad_qq_activity_splash.xml
+++ b/zhuike/src/main/res/layout/ad_qq_activity_splash.xml
@@ -38,6 +38,7 @@
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="16dp"
+ android:layout_marginTop="20dp"
android:background="@drawable/background_circle"
android:gravity="center"
android:text="@string/click_to_skip"
diff --git a/zhuike/src/main/res/layout/ad_toutiao_native_ad.xml b/zhuike/src/main/res/layout/ad_toutiao_native_ad.xml
index 5c30594..5146d6e 100644
--- a/zhuike/src/main/res/layout/ad_toutiao_native_ad.xml
+++ b/zhuike/src/main/res/layout/ad_toutiao_native_ad.xml
@@ -41,7 +41,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/llTitle"
- android:src="@drawable/toutiao_splash_banner"
+
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
@@ -60,12 +60,16 @@
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
tools:ignore="UseCompoundDrawables">
-
-
+ android:background="@drawable/tt_dislike_icon" />-->
+
#FF7F50
#FF6347
+ #FFFAFA
#008577
#00574B
+
+
#D81B60
#000000
#000000
diff --git a/zhuike/src/main/res/values/strings.xml b/zhuike/src/main/res/values/strings.xml
index 42546c3..038858b 100644
--- a/zhuike/src/main/res/values/strings.xml
+++ b/zhuike/src/main/res/values/strings.xml
@@ -1,5 +1,5 @@
- 网书助手(测试)
+ 网书助手
书架
书城
排行榜
@@ -132,7 +132,7 @@
重试
已是最新版本
有新版本了
- 强制更新
+ 您版本太低,请升级版本
更新日志
更新
以后再说
@@ -153,6 +153,15 @@
gdtslogan
点击跳过
没有缓存
+
+ 授权成功
+ 授权失败
-
+ 说明
+ Grant the following permissions to continue the program:\n\n%1$s
+ 设置
+ 继续
+ 取消
+ Please give us permission in the settings:\n\n%1$s
+ The user comes back from the settings page.
diff --git a/zhuike/zhuike.iml b/zhuike/zhuike.iml
index aac38cb..7128a1a 100644
--- a/zhuike/zhuike.iml
+++ b/zhuike/zhuike.iml
@@ -17,7 +17,8 @@
-
+
+
@@ -92,6 +93,7 @@
+
@@ -102,32 +104,33 @@
-
+
+
+
-
-
+
+
-
@@ -191,7 +194,6 @@
-