pull/45/head
kunfei 5 years ago
parent 7de42ef988
commit 09c8018e44
  1. 5
      app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt

@ -16,7 +16,6 @@ import kotlinx.coroutines.Dispatchers
class AudioPlayViewModel(application: Application) : BaseViewModel(application) {
var inBookshelf = false
var bookData = MutableLiveData<Book>()
val chapterListFinish = MutableLiveData<Boolean>()
var chapterSize = 0
var callBack: ReadBookViewModel.CallBack? = null
var durChapterIndex = 0
@ -53,7 +52,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
durChapterIndex = count - 1
}
chapterSize = count
chapterListFinish.postValue(true)
callBack?.loadContent()
}
}
saveRead(book)
@ -83,7 +82,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
if (changeDruChapterIndex == null) {
App.db.bookChapterDao().insert(*cList.toTypedArray())
chapterSize = cList.size
chapterListFinish.postValue(true)
callBack?.loadContent()
} else {
changeDruChapterIndex(cList)
}

Loading…
Cancel
Save