From 237a8e9883ab36bb429d727337d61188d96e5243 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 8 May 2022 18:43:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/read/config/ReadAloudDialog.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt index 181a50c39..8d4deac83 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt @@ -85,7 +85,7 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) { upTimerText(BaseReadAloudService.timeMinute) seekTimer.progress = BaseReadAloudService.timeMinute cbTtsFollowSys.isChecked = requireContext().getPrefBoolean("ttsFollowSys", true) - seekTtsSpeechRate.isEnabled = !cbTtsFollowSys.isChecked + upTtsSpeechRateEnabled(!cbTtsFollowSys.isChecked) upSeekTimer() } @@ -110,7 +110,7 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) { llToBackstage.setOnClickListener { callBack?.finish() } cbTtsFollowSys.setOnCheckedChangeListener { _, isChecked -> AppConfig.ttsFlowSys = isChecked - seekTtsSpeechRate.isEnabled = !isChecked + upTtsSpeechRateEnabled(!isChecked) upTtsSpeechRate() } ivTtsSpeechReduce.setOnClickListener { @@ -142,6 +142,14 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) { }) } + private fun upTtsSpeechRateEnabled(enabled: Boolean) { + binding.run { + seekTtsSpeechRate.isEnabled = enabled + ivTtsSpeechReduce.isEnabled = enabled + ivTtsSpeechAdd.isEnabled = enabled + } + } + private fun upPlayState() { if (!BaseReadAloudService.pause) { binding.ivPlayPause.setImageResource(R.drawable.ic_pause_24dp)