From 78481ee3c454f8a384d76ca6217db7adfb1479f5 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 8 Sep 2019 17:34:52 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/service/ReadAloudService.kt | 7 +++++++ 1 file changed, 7 insertions(+) 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 02675489a..604c27830 100644 --- a/app/src/main/java/io/legado/app/service/ReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/ReadAloudService.kt @@ -424,6 +424,13 @@ class ReadAloudService : BaseService(), TextToSpeech.OnInitListener, override fun onStart(s: String) { postEvent(Bus.TTS_START, readAloudNumber + 1) + textChapter?.let { + if (readAloudNumber + 1 > it.getReadLength(pageIndex + 1)) { + pageIndex++ + postEvent(Bus.TTS_TURN_PAGE, 1) + postEvent(Bus.TTS_START, readAloudNumber + 1) + } + } } override fun onDone(s: String) {