From 0ab1cb89588f5d8d27bafa662ee26e1cd2fcdfb5 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 6 Mar 2020 09:25:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/config/ReadAloudDialog.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 b295a05dc..5540d0386 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 @@ -62,6 +62,7 @@ class ReadAloudDialog : BaseDialogFragment() { private fun initData() { upPlayState() + upTimerText(BaseReadAloudService.timeMinute) seek_timer.progress = BaseReadAloudService.timeMinute cb_tts_follow_sys.isChecked = requireContext().getPrefBoolean("ttsFollowSys", true) seek_tts_SpeechRate.isEnabled = !cb_tts_follow_sys.isChecked @@ -89,7 +90,7 @@ class ReadAloudDialog : BaseDialogFragment() { }) seek_timer.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { - tv_timer.text = requireContext().getString(R.string.timer_m, progress) + upTimerText(progress) } override fun onStartTrackingTouch(seekBar: SeekBar?) = Unit @@ -126,6 +127,10 @@ class ReadAloudDialog : BaseDialogFragment() { } } + private fun upTimerText(timeMinute: Int) { + tv_timer.text = requireContext().getString(R.string.timer_m, timeMinute) + } + private fun upTtsSpeechRate() { ReadAloud.upTtsSpeechRate(requireContext()) if (!BaseReadAloudService.pause) {