pull/32/head
kunfei 5 years ago
parent 5c85dd67a6
commit 4bd9d45b94
  1. 2
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -24,6 +24,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
var webBook: WebBook? = null var webBook: WebBook? = null
var callBack: CallBack? = null var callBack: CallBack? = null
var durChapterIndex = 0 var durChapterIndex = 0
var durPageIndex = 0
var isLocalBook = true var isLocalBook = true
var prevTextChapter: TextChapter? = null var prevTextChapter: TextChapter? = null
var curTextChapter: TextChapter? = null var curTextChapter: TextChapter? = null
@ -38,6 +39,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
App.db.bookDao().getBook(bookUrl)?.let { book -> App.db.bookDao().getBook(bookUrl)?.let { book ->
bookData.postValue(book) bookData.postValue(book)
durChapterIndex = book.durChapterIndex durChapterIndex = book.durChapterIndex
durPageIndex = book.durChapterPos
isLocalBook = book.origin == BookType.local isLocalBook = book.origin == BookType.local
bookSource = App.db.bookSourceDao().getBookSource(book.origin) bookSource = App.db.bookSourceDao().getBookSource(book.origin)
bookSource?.let { bookSource?.let {

Loading…
Cancel
Save