优化
This commit is contained in:
@@ -24,15 +24,15 @@ object IntentHelp {
|
||||
return intent
|
||||
}
|
||||
|
||||
fun toTTSSetting(context: Context) {
|
||||
fun openTTSSetting() {
|
||||
//跳转到文字转语音设置界面
|
||||
kotlin.runCatching {
|
||||
val intent = Intent()
|
||||
intent.action = "com.android.settings.TTS_SETTINGS"
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
context.startActivity(intent)
|
||||
appCtx.startActivity(intent)
|
||||
}.onFailure {
|
||||
context.toastOnUi(R.string.tip_cannot_jump_setting_page)
|
||||
appCtx.toastOnUi(R.string.tip_cannot_jump_setting_page)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import io.legado.app.base.BasePreferenceFragment
|
||||
import io.legado.app.constant.EventBus
|
||||
import io.legado.app.constant.PreferKey
|
||||
import io.legado.app.data.appDb
|
||||
import io.legado.app.help.IntentHelp
|
||||
import io.legado.app.lib.dialogs.SelectItem
|
||||
import io.legado.app.lib.theme.backgroundColor
|
||||
import io.legado.app.lib.theme.primaryColor
|
||||
@@ -92,6 +93,7 @@ class ReadAloudConfigDialog : DialogFragment() {
|
||||
override fun onPreferenceTreeClick(preference: Preference): Boolean {
|
||||
when (preference.key) {
|
||||
PreferKey.ttsEngine -> showDialogFragment(SpeakEngineDialog(this))
|
||||
"sysTtsConfig" -> IntentHelp.openTTSSetting()
|
||||
}
|
||||
return super.onPreferenceTreeClick(preference)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user