From 25da02eed5198e6ccb6a17068c41d659f28ba7b6 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 26 Aug 2019 17:42:09 +0800 Subject: [PATCH] up --- .../java/io/legado/app/service/ReadAloudService.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/ReadAloudService.kt b/app/src/main/java/io/legado/app/service/ReadAloudService.kt index ddfaae1f8..61d9ff5f3 100644 --- a/app/src/main/java/io/legado/app/service/ReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/ReadAloudService.kt @@ -230,13 +230,19 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, AudioManage } private fun prevP() { - nowSpeak++ - playTTS() + if (nowSpeak < contentList.size - 1) { + readAloudNumber += contentList[nowSpeak].length + nowSpeak++ + playTTS() + } } private fun nextP() { - nowSpeak-- - playTTS() + if (nowSpeak > 0) { + nowSpeak-- + readAloudNumber -= contentList[nowSpeak].length + playTTS() + } } /**