pull/78/head
kunfei 5 years ago
parent 03c58f35f7
commit cb7bad6c0f
  1. 6
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  2. 1
      app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt

@ -298,9 +298,15 @@ class BookInfoActivity :
} }
requestCodeChapterList -> if (resultCode == Activity.RESULT_OK) { requestCodeChapterList -> if (resultCode == Activity.RESULT_OK) {
viewModel.bookData.value?.let { viewModel.bookData.value?.let {
data?.getIntExtra("index", it.durChapterIndex)?.let { index ->
if (it.durChapterIndex != index) {
it.durChapterIndex = index
it.durChapterPos = 0
}
readBook(it) readBook(it)
} }
} }
} }
} }
}
} }

@ -14,7 +14,6 @@ import io.legado.app.model.WebBook
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO
class BookInfoViewModel(application: Application) : BaseViewModel(application) { class BookInfoViewModel(application: Application) : BaseViewModel(application) {
val bookData = MutableLiveData<Book>() val bookData = MutableLiveData<Book>()
val chapterListData = MutableLiveData<List<BookChapter>>() val chapterListData = MutableLiveData<List<BookChapter>>()
val isLoadingData = MutableLiveData<Boolean>() val isLoadingData = MutableLiveData<Boolean>()

Loading…
Cancel
Save