From 011e21327fc099bada13fa04338ed6d076fd4e56 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Mon, 7 Feb 2022 09:17:36 +0800 Subject: [PATCH] fix bug --- app/release.md | 8 +-- app/src/main/assets/updatelog.fy | 14 ++--- .../myreader/application/CrashHandler.java | 2 - .../model/third3/webBook/BookChapterList.kt | 4 +- .../myreader/ui/activity/CrashActivity.java | 1 + .../myreader/ui/activity/ReadActivity.java | 51 ++++++++++--------- .../myreader/ui/activity/RestartActivity.kt | 1 + 7 files changed, 45 insertions(+), 36 deletions(-) diff --git a/app/release.md b/app/release.md index c653de4..92a0c53 100644 --- a/app/release.md +++ b/app/release.md @@ -1,3 +1,5 @@ -* 1、兼容第三方书源3.0版本(注意:需要重新导入书源) -* 2、修复已知bug -* 3、优化部分功能 \ No newline at end of file +* 1、修复第三方书源书籍更新后未读章节提示不高亮的问题 +* 2、修复日夜间切换闪退bug +* 3、修复部分发现无法加载下一页的问题 +* 4、新增应用崩溃记录界面 +* 6、书源网络支持蓝奏云文件链接(如有密码,用逗号隔开) \ No newline at end of file diff --git a/app/src/main/assets/updatelog.fy b/app/src/main/assets/updatelog.fy index 1d3203f..88f0872 100644 --- a/app/src/main/assets/updatelog.fy +++ b/app/src/main/assets/updatelog.fy @@ -1,9 +1,11 @@ -2022.01.23 -风月读书v2.3.5 -更新内容: -1、修复部分发现无法加载下一页的问题 -2、新增应用崩溃记录界面 -3、书源网络支持蓝奏云文件链接(如有密码,用逗号隔开) +2022.02.07 +风月读书v2.3.6 +更新内容: +1、修复第三方书源书籍更新后未读章节提示不高亮的问题 +2、修复日夜间切换闪退bug +3、修复部分发现无法加载下一页的问题 +4、新增应用崩溃记录界面 +6、书源网络支持蓝奏云文件链接(如有密码,用逗号隔开) 2022.01.21 风月读书v2.3.4 diff --git a/app/src/main/java/xyz/fycz/myreader/application/CrashHandler.java b/app/src/main/java/xyz/fycz/myreader/application/CrashHandler.java index fcef098..40f2c51 100644 --- a/app/src/main/java/xyz/fycz/myreader/application/CrashHandler.java +++ b/app/src/main/java/xyz/fycz/myreader/application/CrashHandler.java @@ -94,10 +94,8 @@ public final class CrashHandler implements Thread.UncaughtExceptionHandler { boolean deadlyCrash = currentCrashTime - lastCrashTime < 1000 * 60 * 5; // 如果是致命的异常,或者是调试模式下 if (deadlyCrash || App.isDebug()) { - ToastUtils.showError("程序发生致命错误"); CrashActivity.start(mApplication, throwable, logFilePath); } else { - ToastUtils.showError("程序发生错误,正在为您重启"); RestartActivity.Companion.start(mApplication); } diff --git a/app/src/main/java/xyz/fycz/myreader/model/third3/webBook/BookChapterList.kt b/app/src/main/java/xyz/fycz/myreader/model/third3/webBook/BookChapterList.kt index 16a0eee..4d31645 100644 --- a/app/src/main/java/xyz/fycz/myreader/model/third3/webBook/BookChapterList.kt +++ b/app/src/main/java/xyz/fycz/myreader/model/third3/webBook/BookChapterList.kt @@ -124,12 +124,12 @@ object BookChapterList { book.newestChapterTitle = list.last().title book.historyChapterId = list.getOrNull(book.histtoryChapterNum)?.title ?: book.newestChapterTitle - if (book.chapterTotalNum < list.size) { + /*if (book.chapterTotalNum < list.size) { book.noReadNum = list.size - book.chapterTotalNum book.lastReadTime = System.currentTimeMillis() } book.lastReadTime = System.currentTimeMillis() - book.chapterTotalNum = list.size + book.chapterTotalNum = list.size*/ return list } diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/CrashActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/CrashActivity.java index 8fa674a..9edfbca 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/CrashActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/CrashActivity.java @@ -81,6 +81,7 @@ public class CrashActivity extends BaseActivity { @Override protected void initData(Bundle savedInstanceState) { + ToastUtils.showError("程序发生致命错误"); Throwable throwable = (Throwable) getIntent().getSerializableExtra(INTENT_CRASH_KEY); logFilePath = getIntent().getStringExtra(INTENT_LOG_KEY); if (throwable == null) { diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java index 9f1b8a3..c965ff1 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java @@ -13,6 +13,7 @@ import android.content.pm.ActivityInfo; import android.graphics.BitmapFactory; import android.graphics.Color; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.speech.tts.TextToSpeech; @@ -421,7 +422,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe pagePos = pos; saveLastChapterReadPosition(); } - mHandler.post(()->{ + mHandler.post(() -> { screenOffTimerStart(); initMenu(); }); @@ -1065,7 +1066,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe * 保存最后阅读章节的进度 */ public void saveLastChapterReadPosition() { - if (!StringHelper.isEmpty(mBook.getId()) && mPageLoader.getPageStatus() == PageLoader.STATUS_FINISH) { + if (mBook != null && !StringHelper.isEmpty(mBook.getId()) && mPageLoader.getPageStatus() == PageLoader.STATUS_FINISH) { mBook.setLastReadPosition(pagePos); mBook.setHisttoryChapterNum(chapterPos); mBookService.updateEntity(mBook); @@ -1384,28 +1385,32 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe private void changeNightAndDaySetting(boolean isNight) { mSetting.setDayStyle(!isNight); SysManager.saveSetting(mSetting); - toggleMenu(true); - mHandler.postDelayed(() -> { - Intent intent = new Intent(this, ReadActivity.class); - if (aBooks != null) { - intent.putExtra(APPCONST.SOURCE_INDEX, mSourceDialog.getSourceIndex()); - BitIntentDataManager.getInstance().putData(intent, aBooks); - } else { - BitIntentDataManager.getInstance().putData(intent, mBook); - } - if (!isCollected) { - intent.putExtra("isCollected", false); - } - exit(); + if (Build.VERSION.SDK_INT >= 31) { + toggleMenu(true); + mHandler.postDelayed(() -> { + Intent intent = new Intent(this, ReadActivity.class); + if (aBooks != null) { + intent.putExtra(APPCONST.SOURCE_INDEX, mSourceDialog.getSourceIndex()); + BitIntentDataManager.getInstance().putData(intent, aBooks); + } else { + BitIntentDataManager.getInstance().putData(intent, mBook); + } + if (!isCollected) { + intent.putExtra("isCollected", false); + } + exit(); + App.getApplication().setNightTheme(isNight); + startActivity(intent); + }, mBottomOutAnim.getDuration()); + } else { App.getApplication().setNightTheme(isNight); - startActivity(intent); - }, mBottomOutAnim.getDuration()); - /*mHandler.postDelayed(() -> { - AppCompatActivity activity = ActivityManage.getByClass(this.getClass()); - if (activity != null) { - BaseDialog.initActivityContext(activity); - } - }, 1000);*/ + mHandler.postDelayed(() -> { + AppCompatActivity activity = ActivityManage.getByClass(this.getClass()); + if (activity != null) { + BaseDialog.initActivityContext(activity); + } + }, 1000); + } //mPageLoader.setPageStyle(!isCurDayStyle); } diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/RestartActivity.kt b/app/src/main/java/xyz/fycz/myreader/ui/activity/RestartActivity.kt index d8586bf..5d939a4 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/RestartActivity.kt +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/RestartActivity.kt @@ -26,6 +26,7 @@ class RestartActivity : BaseActivity() { } fun restart(context: Context) { + ToastUtils.showError("程序发生错误,正在为您重启") val intent = Intent(context, MainActivity::class.java) if (context !is Activity) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)