diff --git a/zhuike/build.gradle b/zhuike/build.gradle
index 5218324..414e1a9 100644
--- a/zhuike/build.gradle
+++ b/zhuike/build.gradle
@@ -16,8 +16,8 @@ android {
applicationId "com.novelbook.android"
minSdkVersion 19 //target 19 Android 4.4 以下版本仅占比4.1%
targetSdkVersion 28
- versionCode 1
- versionName "1.0"
+ versionCode 2
+ versionName "2.0"
// testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -31,7 +31,7 @@ android {
multiDexEnabled true //突破65535
manifestPlaceholders = [UMENG_CHANNEL_CALUE: "umeng"] //默认为uMeng
- // flavorDimensions "default" //debug时注销
+ // flavorDimensions "default" //debug时注销
}
buildTypes {
debug {
@@ -46,8 +46,8 @@ android {
signingConfig signingConfigs.debug
}
release {
- // 不显示Log
- buildConfigField "boolean", "LOG_DEBUG", "false"
+ // 暂时显示Log 。。。。。。。。。。。。。。。上线时关闭
+ buildConfigField "boolean", "LOG_DEBUG", "true"
//混淆
minifyEnabled true
//Zipalign优化
@@ -55,7 +55,7 @@ android {
// 移除无用的resource文件
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- /* applicationVariants.all { variant ->
+ /* applicationVariants.all { variant ->
variant.outputs.all { output ->
def outFile = output.outputFile
if (outFile != null && outFile.name.endsWith(".apk")) {
@@ -69,7 +69,7 @@ android {
}
}
//渠道
- /* productFlavors {
+ /*productFlavors {
// googleplay {}
A {
applicationId "com.novelbook.android.a"
diff --git a/zhuike/src/A/res/values/strings.xml b/zhuike/src/A/res/values/strings.xml
new file mode 100644
index 0000000..325e7cd
--- /dev/null
+++ b/zhuike/src/A/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ A小说
+
+
diff --git a/zhuike/src/B/res/values/strings.xml b/zhuike/src/B/res/values/strings.xml
new file mode 100644
index 0000000..7eb1948
--- /dev/null
+++ b/zhuike/src/B/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ B小说
+
+
diff --git a/zhuike/src/C/res/values/strings.xml b/zhuike/src/C/res/values/strings.xml
new file mode 100644
index 0000000..841586e
--- /dev/null
+++ b/zhuike/src/C/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ C小说
+
+
diff --git a/zhuike/src/D/res/values/strings.xml b/zhuike/src/D/res/values/strings.xml
new file mode 100644
index 0000000..467090f
--- /dev/null
+++ b/zhuike/src/D/res/values/strings.xml
@@ -0,0 +1,4 @@
+
+ D小说
+
+
diff --git a/zhuike/src/main/AndroidManifest.xml b/zhuike/src/main/AndroidManifest.xml
index d6c3647..4e43144 100644
--- a/zhuike/src/main/AndroidManifest.xml
+++ b/zhuike/src/main/AndroidManifest.xml
@@ -9,7 +9,7 @@
-
+
-
+
+
+
@@ -91,4 +99,5 @@
-->
+
\ No newline at end of file
diff --git a/zhuike/src/main/java/com/novelbook/android/Activity_createShudan.java b/zhuike/src/main/java/com/novelbook/android/Activity_createShudan.java
index 5e80716..ceed343 100644
--- a/zhuike/src/main/java/com/novelbook/android/Activity_createShudan.java
+++ b/zhuike/src/main/java/com/novelbook/android/Activity_createShudan.java
@@ -79,7 +79,7 @@ public class Activity_createShudan extends Activity_base {
protected void setupToolbar(){
super.setupToolbar();
- toolbar.inflateMenu(R.menu.menu_create_shudan);//设置右上角的填充菜单
+ /*toolbar.inflateMenu(R.menu.menu_create_shudan);//设置右上角的填充菜单
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@@ -94,7 +94,7 @@ public class Activity_createShudan extends Activity_base {
}
return true;
}
- });
+ });*/
}
@Override
@@ -130,7 +130,7 @@ public class Activity_createShudan extends Activity_base {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.menu_create_shudan, menu);
+ // getMenuInflater().inflate(R.menu.menu_create_shudan, menu);
return true;
}
diff --git a/zhuike/src/main/java/com/novelbook/android/BookActivity.java b/zhuike/src/main/java/com/novelbook/android/BookActivity.java
index d5000c9..61fc06b 100644
--- a/zhuike/src/main/java/com/novelbook/android/BookActivity.java
+++ b/zhuike/src/main/java/com/novelbook/android/BookActivity.java
@@ -165,7 +165,7 @@ public class BookActivity extends Activity_base {
super.setupToolbar();
// toolbar.setTitleMarginBottom(1);
// toolbar.setTitleTextAppearance(this,R.style.TitleText);
- toolbar.inflateMenu(R.menu.menu_book);//设置右上角的填充菜单
+ /* toolbar.inflateMenu(R.menu.menu_book);//设置右上角的填充菜单
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@@ -176,7 +176,7 @@ public class BookActivity extends Activity_base {
}
return true;
}
- });
+ });*/
}
public final static String EXTRA_BOOK ="book";
@@ -202,6 +202,7 @@ public class BookActivity extends Activity_base {
NetUtil.cancelRequest(mNovel.getNovelId());
getBookInfo();
+
}
/**
diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/CatalogFragment.java b/zhuike/src/main/java/com/novelbook/android/Fragments/CatalogFragment.java
index 1dbc82b..ebe4510 100644
--- a/zhuike/src/main/java/com/novelbook/android/Fragments/CatalogFragment.java
+++ b/zhuike/src/main/java/com/novelbook/android/Fragments/CatalogFragment.java
@@ -177,8 +177,9 @@ public class CatalogFragment extends BasicFragment implements MarkActivity.Sortc
}
}
+ int maxSlept =NetUtil.isNetworkConnected()?50 :200;
int slepttime = 0;
- while (NetUtil.isNetworkConnected() &&( slepttime < 200 && ( pageFactory.isReadingCatalogs() || pageFactory.getChapters().size() == 0))) {
+ while ( slepttime < maxSlept && ( pageFactory.isReadingCatalogs() || pageFactory.getChapters().size() == 0)) {
try {
Log.d(TAG, String .format("prepare book: to open book cate to sleep %s" , 50));
sleep(50);
diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_bangdan.java b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_bangdan.java
index 106997a..684fcaa 100644
--- a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_bangdan.java
+++ b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_bangdan.java
@@ -28,6 +28,7 @@ import butterknife.BindView;
public class Fragment_bangdan extends BasicFragment {
+ public static final String TAG=Fragment_bangdan.class.getSimpleName();
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
@@ -159,7 +160,7 @@ public class Fragment_bangdan extends BasicFragment {
@Override
public void setFTag() {
- TAG ="com.novelbook.android.Fragments.Fragment_bangdan";
+
}
diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_jingxuan_tuijian.java b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_jingxuan_tuijian.java
index af6a3b5..7279b6a 100644
--- a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_jingxuan_tuijian.java
+++ b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_jingxuan_tuijian.java
@@ -18,7 +18,7 @@ import butterknife.ButterKnife;
import butterknife.OnClick;
public class Fragment_jingxuan_tuijian extends BasicFragment {
- public static String TAG=Fragment_jingxuan.class.getSimpleName();
+ final public static String TAG =Fragment_jingxuan.class.getSimpleName();
@BindView(R.id.imageGallary1)
ImageView imageView1;
@BindView(R.id.imageGallary2)
@@ -130,7 +130,7 @@ public class Fragment_jingxuan_tuijian extends BasicFragment {
@Override
public void setFTag() {
- TAG="com.novelbook.android.Fragments.Fragment_jingxuan_tuijian";
+
}
diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_paihang.java b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_paihang.java
index b444698..fe3fd1b 100644
--- a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_paihang.java
+++ b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_paihang.java
@@ -172,8 +172,7 @@ final String TAG = Fragment_paihang.class.getSimpleName();
@Override
public void onLinearOutClick(View view, int position, int llId) {
- Toast.makeText(activity, "book " + position + " clicked",
- Toast.LENGTH_SHORT).show();
+
}
});
mAdapter.setShowTop(true);
@@ -328,8 +327,7 @@ final String TAG = Fragment_paihang.class.getSimpleName();
- Toast.makeText(activity, selectedKey,
- Toast.LENGTH_SHORT).show();
+ // Toast.makeText(activity, selectedKey, Toast.LENGTH_SHORT).show();
tvHint.setText(selectedKey);
Log.d(TAG, String.format("tabChanged: to load data %s,pageno %s, tmp %s" , selectedKey,pageNo ,tmp));
diff --git a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_shudan_list.java b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_shudan_list.java
index b398a17..8f01809 100644
--- a/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_shudan_list.java
+++ b/zhuike/src/main/java/com/novelbook/android/Fragments/Fragment_shudan_list.java
@@ -20,7 +20,7 @@ import java.util.List;
import butterknife.BindView;
public class Fragment_shudan_list extends BasicFragment {
-
+ public static String TAG=Fragment_shudan_list.class.getSimpleName();
private char cnt;
ShudanAdapter mAdapter;
diff --git a/zhuike/src/main/java/com/novelbook/android/Main2Activity.java b/zhuike/src/main/java/com/novelbook/android/Main2Activity.java
index 8cf24eb..40a1a7f 100644
--- a/zhuike/src/main/java/com/novelbook/android/Main2Activity.java
+++ b/zhuike/src/main/java/com/novelbook/android/Main2Activity.java
@@ -1,6 +1,7 @@
package com.novelbook.android;
import android.content.Intent;
+import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
@@ -84,7 +85,7 @@ public class Main2Activity extends Activity_base
// ButterKnife.bind(this);
initialSexOption();
- // checkUpdate(true);
+ checkUpdate(true);
// getSearchTabTtitle();
}
@@ -171,17 +172,16 @@ public class Main2Activity extends Activity_base
}else */
- if(menuItemId == R.id.menuMore) {
+ if(menuItemId == R.id.menuMore) {
showShelfMoreSheet();
}
else if(menuItemId == R.id.menuFinshi) {
udateShelfZhengli();
- } if(menuItemId==R.id.menuSearch){
+ } else if(menuItemId==R.id.menuSearch){
Intent intent = new Intent(Main2Activity.this,Activity_Search.class);
startActivity(intent);
- }
- if(menuItemId==R.id.menuHistory){
+ }else if(menuItemId==R.id.menuHistory){
Intent intent = new Intent(Main2Activity.this,Activity_paihangbang.class);
intent.putExtra(Activity_paihangbang.EXTR_HISTORY,"yes");
@@ -276,9 +276,7 @@ public class Main2Activity extends Activity_base
// Handle navigation view item clicks here.
int id = item.getItemId();
- if (id == R.id.nav_camera) {
- // Handle the camera action
- } else if (id == R.id.nav_gallery) {
+ if (id == R.id.nav_history) {
Intent intent = new Intent(Main2Activity.this,Activity_paihangbang.class);
intent.putExtra(Activity_paihangbang.EXTR_HISTORY,"yes");
intent.putExtra(Activity_paihangbang.EXTR_TITLE,"我曾经看过的书");
@@ -287,13 +285,15 @@ public class Main2Activity extends Activity_base
startDownloadService();
Intent intent = new Intent(Main2Activity.this,Activity_cache.class);
startActivity(intent);
- } else if (id == R.id.nav_manage) {
-
- } else if (id == R.id.nav_share) {
-
- } else if (id == R.id.nav_send) {
-
- }
+ } else if (id == R.id.nav_advice) {
+ Uri uri = Uri.parse("mailto:"+ Constants.email);
+ String[] email = {Constants.email};
+ Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
+ intent.putExtra(Intent.EXTRA_CC, email); // 抄送人
+ intent.putExtra(Intent.EXTRA_SUBJECT, "意见建议"); // 主题
+ intent.putExtra(Intent.EXTRA_TEXT, "请输入内容"); // 正文
+ startActivity(Intent.createChooser(intent, "请选择邮件应用"));
+ }
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
@@ -472,6 +472,19 @@ private int bottomSelectedIndex;
// setTitle("title on resume");
// checkUpdate(true);
// getHostPolicy();
+
+ Fragment current = getSupportFragmentManager().findFragmentById(R.id.realtabcontent);
+ if (current != null && current instanceof Fragment_Shelf){
+ // Log.d(TAG, "onResume: current is shelf, botoomNavigation selection is 0? " +(botoomNavigation.getSelectedItemId() == R.id.navigation_home));
+ if(botoomNavigation.getSelectedItemId()!= R.id.navigation_home){
+ botoomNavigation.setSelectedItemId( R.id.navigation_home);
+
+ // Log.d(TAG, "onResume: set botoomNav selection to 0");
+ }
+
+ }
+
+
}
@Override
diff --git a/zhuike/src/main/java/com/novelbook/android/ReadActivity.java b/zhuike/src/main/java/com/novelbook/android/ReadActivity.java
index 60cb49d..be3443e 100644
--- a/zhuike/src/main/java/com/novelbook/android/ReadActivity.java
+++ b/zhuike/src/main/java/com/novelbook/android/ReadActivity.java
@@ -419,6 +419,7 @@ public class ReadActivity extends Activity_base implements SpeechSynthesizerLis
if (isShow) {
hideReadSetting();
return false;
+
}
if (isShow || isSpeaking){
// return 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 288817d..90395f1 100644
--- a/zhuike/src/main/java/com/novelbook/android/adapter/BookListAdapter.java
+++ b/zhuike/src/main/java/com/novelbook/android/adapter/BookListAdapter.java
@@ -215,7 +215,8 @@ public class BookListAdapter extends RecyclerView.Adapter< RecyclerView.ViewHol
if (holder.tvDesc != null) holder.tvDesc.setText(mDatas.get(position).getDesc());
if (holder.tvLastRead != null) holder.tvLastRead.setText(CommonUtil.getDateString( mDatas.get(position).getLastVisit() ));
- if (holder.tvProgress != null) holder.tvProgress.setText( String.format("上次看到第 %s 章,共%s章",mDatas.get(position).getLastReadChapt(),mDatas.get(position).getChaptCnt()) );
+ // if (holder.tvProgress != null) holder.tvProgress.setText( String.format("上次看到第 %s 章,共%s章",mDatas.get(position).getLastReadChapt(),mDatas.get(position).getChaptCnt()) );
+ if (holder.tvProgress != null) holder.tvProgress.setText( String.format("上次看到第 %s 章",mDatas.get(position).getLastReadChapt(),mDatas.get(position).getChaptCnt()) );
if (holder.tvReadtime != null) holder.tvReadtime.setText( "总计阅读了 "+CommonUtil.getTimeCnt4Read( mDatas.get(position).getReadtime() ,true) );
diff --git a/zhuike/src/main/java/com/novelbook/android/filechooser/DirectoryFragment.java b/zhuike/src/main/java/com/novelbook/android/filechooser/DirectoryFragment.java
index f336f36..c1c3ea6 100644
--- a/zhuike/src/main/java/com/novelbook/android/filechooser/DirectoryFragment.java
+++ b/zhuike/src/main/java/com/novelbook/android/filechooser/DirectoryFragment.java
@@ -46,7 +46,7 @@ import java.util.HashMap;
import java.util.List;
public class DirectoryFragment extends Fragment implements View.OnClickListener {
-
+ public static final String TAG =DirectoryFragment.class.getSimpleName();
private View fragmentView;
private boolean receiverRegistered = false;
private File currentDir;
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 a98f814..16b3460 100644
--- a/zhuike/src/main/java/com/novelbook/android/netutils/NetUtil.java
+++ b/zhuike/src/main/java/com/novelbook/android/netutils/NetUtil.java
@@ -317,6 +317,7 @@ public class NetUtil {
Constants.LAST_G = new Date().getTime();
Constants.announcement =jsonObject.getString("declare");
+ Constants.email =jsonObject.getString("email");
// config.setRootUrl( jsonObject.getString("masterDomains"));
isRequestHosts =false;
} catch (Exception e) {
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 25f07ac..f039ebe 100644
--- a/zhuike/src/main/java/com/novelbook/android/upgrade/UpdateManager.java
+++ b/zhuike/src/main/java/com/novelbook/android/upgrade/UpdateManager.java
@@ -21,15 +21,19 @@ import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
+import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
+import android.support.v4.content.FileProvider;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;
+import com.novelbook.android.BuildConfig;
+import com.novelbook.android.MyApp;
import com.novelbook.android.R;
import com.novelbook.android.ReadActivity;
import com.novelbook.android.db.Novel;
@@ -295,46 +299,12 @@ public class UpdateManager {
*/
private void showNoticeDialog()
{
-
-
- /*final AlertDialog.Builder normalDialog =
- new AlertDialog.Builder(mContext);
-
- normalDialog.setTitle("退出阅读");
- normalDialog.setMessage("确定退出阅读吗?");
- normalDialog.setPositiveButton("继续阅读",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
-
- }
- });
- normalDialog.setNegativeButton("退出阅读",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
-
- }
- });
-
- normalDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
- @Override
- public void onDismiss(DialogInterface dialog) {
-
- }
- });
-
- // 显示
- normalDialog.show();
-*/
-
-
// 閺嬪嫰锟界�纭呯樈濡楋拷
Builder builder = new Builder(mContext);
builder.setTitle(R.string.soft_update_title);
String upgradeDetails=mHashMap.get("details");
- builder.setMessage( mContext.getPackageName() + " "+ mContext.getString(R.string.soft_update_info) +upgradeDetails );
+ builder.setMessage( mContext.getPackageName() + " "+getVersionCode(mContext) +" " +mContext.getString(R.string.soft_update_info) +upgradeDetails );
builder.setPositiveButton(R.string.soft_update_updatebtn, new OnClickListener()
{
@Override
@@ -480,7 +450,18 @@ public class UpdateManager {
}
// 闁俺绻僆ntent鐎瑰顥朅PK閺傚洣娆�
Intent i = new Intent(Intent.ACTION_VIEW);
- i.setDataAndType(Uri.parse("file://" + apkfile.toString()), "application/vnd.android.package-archive");
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
+ i.setDataAndType(Uri.parse("file://" + apkfile.toString()), "application/vnd.android.package-archive");
+ i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ } else {
+ // 声明需要的临时权限
+ // 第二个参数,即第一步中配置的authorities
+ Uri contentUri = FileProvider.getUriForFile(MyApp.applicationContext, BuildConfig.APPLICATION_ID + ".provider", apkfile);
+ i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+ i.setDataAndType(contentUri, "application/vnd.android.package-archive");
+ }
+
+
mContext.startActivity(i);
}
}
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 1927c42..d95e06d 100644
--- a/zhuike/src/main/java/com/novelbook/android/utils/Constants.java
+++ b/zhuike/src/main/java/com/novelbook/android/utils/Constants.java
@@ -22,10 +22,12 @@ public class Constants {
public static List lstNt=null;
//public static List