pull/47/head
kunfei 5 years ago
parent d5142eda4c
commit ebc606cf47
  1. 2
      app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt
  2. 11
      app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt

@ -45,7 +45,7 @@ class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_a
true true
} }
iv_skip_next.onClick { iv_skip_next.onClick {
viewModel.moveToNext()
} }
iv_skip_previous.onClick { iv_skip_previous.onClick {

@ -184,6 +184,17 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
} }
} }
fun moveToPrev() {
if (durChapterIndex > 0) {
durChapterIndex--
bookData.value?.let {
it.durChapterIndex = durChapterIndex
saveRead(it)
loadContent(it, durChapterIndex)
}
}
}
fun moveToNext() { fun moveToNext() {
if (durChapterIndex < chapterSize - 1) { if (durChapterIndex < chapterSize - 1) {
durChapterIndex++ durChapterIndex++

Loading…
Cancel
Save