From 6433d17a685db9364a351594cc165cc54d204cb8 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sat, 1 Oct 2022 09:11:22 +0800 Subject: [PATCH] chore: rename EventBus.BOOK_URL_CHANGED --- app/src/main/java/io/legado/app/constant/EventBus.kt | 2 +- .../legado/app/ui/association/ImportOnLineBookFileViewModel.kt | 2 +- .../main/java/io/legado/app/ui/book/info/BookInfoActivity.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/constant/EventBus.kt b/app/src/main/java/io/legado/app/constant/EventBus.kt index e111bdc98..06264871c 100644 --- a/app/src/main/java/io/legado/app/constant/EventBus.kt +++ b/app/src/main/java/io/legado/app/constant/EventBus.kt @@ -28,6 +28,6 @@ object EventBus { const val TIP_COLOR = "tipColor" const val SOURCE_CHANGED = "sourceChanged" const val SEARCH_RESULT = "searchResult" - const val BOOK_URL_CHANGED = "bookUrlChanged" + const val FILE_SOURCE_DOWNLOAD_DONE = "fileSourceDownloadDone" const val updateReadActionBar = "updateReadActionBar" } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt b/app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt index 4054e0fbd..667c9042c 100644 --- a/app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt @@ -66,7 +66,7 @@ class ImportOnLineBookFileViewModel(app: Application) : BaseViewModel(app) { fun importOnLineBookFile(url: String, fileName: String, success: () -> Unit) { execute { LocalBook.importFileOnLine(url, fileName, bookSource).let { - postEvent(EventBus.BOOK_URL_CHANGED, it.bookUrl) + postEvent(EventBus.FILE_SOURCE_DOWNLOAD_DONE, it.bookUrl) } }.onSuccess { success.invoke() diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index bc57da9dd..a21ab4aa8 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -535,7 +535,7 @@ class BookInfoActivity : } override fun observeLiveBus() { - observeEvent(EventBus.BOOK_URL_CHANGED) { + observeEvent(EventBus.FILE_SOURCE_DOWNLOAD_DONE) { viewModel.changeToLocalBook(it) } }