From 5e83f6f45d8947e235a5ca15ff89488404ff7ed6 Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Fri, 9 Jul 2021 10:03:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E4=B9=A6=E6=BA=90bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/xyz/fycz/myreader/greendao/entity/Book.java | 6 ++++++ .../xyz/fycz/myreader/ui/activity/BookDetailedActivity.java | 3 ++- .../java/xyz/fycz/myreader/ui/activity/ReadActivity.java | 1 + .../main/java/xyz/fycz/myreader/util/help/JsExtensions.java | 2 -- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/xyz/fycz/myreader/greendao/entity/Book.java b/app/src/main/java/xyz/fycz/myreader/greendao/entity/Book.java index e6909fb..0379bd4 100644 --- a/app/src/main/java/xyz/fycz/myreader/greendao/entity/Book.java +++ b/app/src/main/java/xyz/fycz/myreader/greendao/entity/Book.java @@ -413,4 +413,10 @@ public class Book implements Serializable { } return catheMap.get(key); } + + public void clearCathe(){ + if (catheMap != null) { + catheMap.clear(); + } + } } diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java index d8bbce5..920908c 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java @@ -264,8 +264,10 @@ public class BookDetailedActivity extends BaseActivity { //换源对话框 mSourceDialog.setOnSourceChangeListener((bean, pos) -> { Book bookTem = (Book) mBook.clone(); + bookTem.clearCathe(); bookTem.setChapterUrl(bean.getChapterUrl()); bookTem.setInfoUrl(bean.getInfoUrl()); + bookTem.setSource(bean.getSource()); if (!StringHelper.isEmpty(bean.getImgUrl())) { bookTem.setImgUrl(bean.getImgUrl()); } @@ -284,7 +286,6 @@ public class BookDetailedActivity extends BaseActivity { if (!StringHelper.isEmpty(bean.getStatus())) { bookTem.setStatus(bean.getStatus()); } - bookTem.setSource(bean.getSource()); if (isCollected) { mBookService.updateBook(mBook, bookTem); } 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 f736b91..3280529 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 @@ -479,6 +479,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe mSourceDialog.setOnSourceChangeListener((bean, pos) -> { Book bookTem = (Book) mBook.clone(); + bookTem.clearCathe(); bookTem.setInfoUrl(bean.getInfoUrl()); bookTem.setChapterUrl(bean.getChapterUrl()); bookTem.setSource(bean.getSource()); diff --git a/app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java b/app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java index 5ce1fbe..f7dea3e 100644 --- a/app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java +++ b/app/src/main/java/xyz/fycz/myreader/util/help/JsExtensions.java @@ -33,8 +33,6 @@ import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.StringUtils; @Keep - - @SuppressWarnings({"unused"}) public interface JsExtensions { String TAG = JsExtensions.class.getSimpleName();