chore: rename EventBus.BOOK_URL_CHANGED

pull/2361/head
Xwite 2 years ago committed by Xwite
parent e6f431a139
commit 6433d17a68
  1. 2
      app/src/main/java/io/legado/app/constant/EventBus.kt
  2. 2
      app/src/main/java/io/legado/app/ui/association/ImportOnLineBookFileViewModel.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt

@ -28,6 +28,6 @@ object EventBus {
const val TIP_COLOR = "tipColor" const val TIP_COLOR = "tipColor"
const val SOURCE_CHANGED = "sourceChanged" const val SOURCE_CHANGED = "sourceChanged"
const val SEARCH_RESULT = "searchResult" const val SEARCH_RESULT = "searchResult"
const val BOOK_URL_CHANGED = "bookUrlChanged" const val FILE_SOURCE_DOWNLOAD_DONE = "fileSourceDownloadDone"
const val updateReadActionBar = "updateReadActionBar" const val updateReadActionBar = "updateReadActionBar"
} }

@ -66,7 +66,7 @@ class ImportOnLineBookFileViewModel(app: Application) : BaseViewModel(app) {
fun importOnLineBookFile(url: String, fileName: String, success: () -> Unit) { fun importOnLineBookFile(url: String, fileName: String, success: () -> Unit) {
execute { execute {
LocalBook.importFileOnLine(url, fileName, bookSource).let { LocalBook.importFileOnLine(url, fileName, bookSource).let {
postEvent(EventBus.BOOK_URL_CHANGED, it.bookUrl) postEvent(EventBus.FILE_SOURCE_DOWNLOAD_DONE, it.bookUrl)
} }
}.onSuccess { }.onSuccess {
success.invoke() success.invoke()

@ -535,7 +535,7 @@ class BookInfoActivity :
} }
override fun observeLiveBus() { override fun observeLiveBus() {
observeEvent<String>(EventBus.BOOK_URL_CHANGED) { observeEvent<String>(EventBus.FILE_SOURCE_DOWNLOAD_DONE) {
viewModel.changeToLocalBook(it) viewModel.changeToLocalBook(it)
} }
} }

Loading…
Cancel
Save