From 24f8996969f5ccf926658375604b3d80561a6924 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 5 Aug 2021 20:10:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt | 1 + .../main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt | 1 + .../main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 1 + 3 files changed, 3 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt b/app/src/main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt index 6877bd036..086443409 100644 --- a/app/src/main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt @@ -100,6 +100,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application) } else { loadChapterList(book1) { upChangeDurChapterIndex(book1, oldTocSize, it) } } + }.onFinally { postEvent(EventBus.SOURCE_CHANGED, book1.bookUrl) } } diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt index eef30dc4e..f7ba8ff00 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt @@ -169,6 +169,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { upChangeDurChapterIndex(newBook, oldTocSize, it) } } + }.onFinally { postEvent(EventBus.SOURCE_CHANGED, newBook.bookUrl) } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index ebaa2f4bf..9395b8f1c 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -209,6 +209,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { upChangeDurChapterIndex(newBook, oldTocSize, it) } } + }.onFinally { postEvent(EventBus.SOURCE_CHANGED, newBook.bookUrl) } }