From d85db50d03f8fc0bc3f8ee63b32d3fdd2035d0cd Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 11 Sep 2019 19:39:22 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/ReadAloud.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/help/ReadAloud.kt b/app/src/main/java/io/legado/app/help/ReadAloud.kt index 91fda2522..5be1bd764 100644 --- a/app/src/main/java/io/legado/app/help/ReadAloud.kt +++ b/app/src/main/java/io/legado/app/help/ReadAloud.kt @@ -2,12 +2,23 @@ package io.legado.app.help import android.content.Context import android.content.Intent +import io.legado.app.App import io.legado.app.constant.Action import io.legado.app.service.BaseReadAloudService +import io.legado.app.service.HttpReadAloudService import io.legado.app.service.TTSReadAloudService +import io.legado.app.utils.getPrefBoolean object ReadAloud { - var aloudClass = TTSReadAloudService::class.java + var aloudClass: Class<*> = getReadAloudClass() + + fun getReadAloudClass(): Class<*> { + return if (App.INSTANCE.getPrefBoolean("tts", true)) { + TTSReadAloudService::class.java + } else { + HttpReadAloudService::class.java + } + } fun play( context: Context,