From d6e0c730db49b273eafeded63b88a514e4dd9f0b Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 11 Sep 2019 16:38:37 +0800 Subject: [PATCH] up --- .../app/service/BaseReadAloudService.kt | 1 + .../app/service/HttpReadAloudService.kt | 21 +++++++++++++++++++ .../legado/app/service/TTSReadAloudService.kt | 1 - 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/io/legado/app/service/HttpReadAloudService.kt diff --git a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt index 35e3ad6c1..cbebfb9f6 100644 --- a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt @@ -138,6 +138,7 @@ abstract class BaseReadAloudService : BaseService(), isRun = false unregisterReceiver(broadcastReceiver) postEvent(Bus.ALOUD_STATE, Status.STOP) + upMediaSessionPlaybackState(PlaybackStateCompat.STATE_STOPPED) } override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { diff --git a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt new file mode 100644 index 000000000..4092fc01d --- /dev/null +++ b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt @@ -0,0 +1,21 @@ +package io.legado.app.service + +class HttpReadAloudService : BaseReadAloudService() { + + override fun newReadAloud(dataKey: String?, play: Boolean) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun upSpeechRate(reset: Boolean) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun prevP() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun nextP() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt index 195fe4fdf..f29cf244c 100644 --- a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt @@ -41,7 +41,6 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener override fun onDestroy() { super.onDestroy() - upMediaSessionPlaybackState(PlaybackStateCompat.STATE_STOPPED) clearTTS() }