|
|
@ -49,7 +49,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
ReadBook.durChapterIndex = count - 1 |
|
|
|
ReadBook.durChapterIndex = count - 1 |
|
|
|
} |
|
|
|
} |
|
|
|
ReadBook.chapterSize = count |
|
|
|
ReadBook.chapterSize = count |
|
|
|
ReadBook.callBack?.loadContent() |
|
|
|
ReadBook.loadContent() |
|
|
|
} |
|
|
|
} |
|
|
|
if (ReadBook.inBookshelf) { |
|
|
|
if (ReadBook.inBookshelf) { |
|
|
|
ReadBook.saveRead() |
|
|
|
ReadBook.saveRead() |
|
|
@ -93,7 +93,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
if (changeDruChapterIndex == null) { |
|
|
|
if (changeDruChapterIndex == null) { |
|
|
|
App.db.bookChapterDao().insert(*cList.toTypedArray()) |
|
|
|
App.db.bookChapterDao().insert(*cList.toTypedArray()) |
|
|
|
ReadBook.chapterSize = cList.size |
|
|
|
ReadBook.chapterSize = cList.size |
|
|
|
ReadBook.callBack?.loadContent() |
|
|
|
ReadBook.loadContent() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
changeDruChapterIndex(cList) |
|
|
|
changeDruChapterIndex(cList) |
|
|
|
} |
|
|
|
} |
|
|
@ -146,7 +146,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
App.db.bookDao().update(book) |
|
|
|
App.db.bookDao().update(book) |
|
|
|
App.db.bookChapterDao().insert(*chapters.toTypedArray()) |
|
|
|
App.db.bookChapterDao().insert(*chapters.toTypedArray()) |
|
|
|
ReadBook.chapterSize = chapters.size |
|
|
|
ReadBook.chapterSize = chapters.size |
|
|
|
ReadBook.callBack?.loadContent() |
|
|
|
ReadBook.loadContent() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -160,7 +160,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
ReadBook.durPageIndex = 0 |
|
|
|
ReadBook.durPageIndex = 0 |
|
|
|
} |
|
|
|
} |
|
|
|
ReadBook.saveRead() |
|
|
|
ReadBook.saveRead() |
|
|
|
ReadBook.callBack?.loadContent() |
|
|
|
ReadBook.loadContent() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun removeFromBookshelf(success: (() -> Unit)?) { |
|
|
|
fun removeFromBookshelf(success: (() -> Unit)?) { |
|
|
|