|
|
@ -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 { |
|
|
|