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() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
AudioPlay.stop(this)
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
Backup.autoBackup() Backup.autoBackup()
} }

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

Loading…
Cancel
Save