diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt index d2a7e19ce..a1c3c145f 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt @@ -45,7 +45,7 @@ class AudioPlayActivity : VMBaseActivity(R.layout.activity_a true } iv_skip_next.onClick { - + viewModel.moveToNext() } iv_skip_previous.onClick { diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt index 458097f54..a3d3877d0 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt @@ -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() { if (durChapterIndex < chapterSize - 1) { durChapterIndex++