diff --git a/app/src/main/java/io/legado/app/service/help/AudioPlay.kt b/app/src/main/java/io/legado/app/service/help/AudioPlay.kt index 87549c8eb..9ebc544c8 100644 --- a/app/src/main/java/io/legado/app/service/help/AudioPlay.kt +++ b/app/src/main/java/io/legado/app/service/help/AudioPlay.kt @@ -131,6 +131,12 @@ object AudioPlay { } } + fun addTimer(context: Context) { + val intent = Intent(context, AudioPlayService::class.java) + intent.action = IntentAction.addTimer + context.startService(intent) + } + fun saveRead() { Coroutine.async { book?.let { book -> 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 93727fb8d..76a60f6bb 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 @@ -115,6 +115,9 @@ class AudioPlayActivity : binding.ivFastRewind.onClick { AudioPlay.adjustSpeed(this, -0.1f) } + binding.ivTimer.onClick { + AudioPlay.addTimer(this) + } } private fun upCover(path: String?) {