pull/47/head
kunfei 5 years ago
parent 9ef0a3a77c
commit e5f3d2f28a
  1. 1
      app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt

@ -204,6 +204,7 @@ class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_a
override fun onDestroy() {
super.onDestroy()
AudioPlay.stop(this)
if (!BuildConfig.DEBUG) {
Backup.autoBackup()
}

@ -191,6 +191,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
fun moveToPrev() {
if (durChapterIndex > 0) {
durChapterIndex--
durPageIndex = 0
book?.durChapterIndex = durChapterIndex
saveRead()
loadContent(durChapterIndex)
@ -200,6 +201,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
fun moveToNext() {
if (durChapterIndex < chapterSize - 1) {
durChapterIndex++
durPageIndex = 0
book?.durChapterIndex = durChapterIndex
saveRead()
loadContent(durChapterIndex)
@ -208,7 +210,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
}
}
fun saveRead() {
private fun saveRead() {
execute {
book?.let { book ->
book.lastCheckCount = 0

Loading…
Cancel
Save