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 1afdc469b..cb5f51127 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
@@ -1,5 +1,6 @@
package io.legado.app.ui.book.read.config
+import android.annotation.SuppressLint
import android.content.DialogInterface
import android.os.Bundle
import android.view.Gravity
@@ -20,10 +21,7 @@ import io.legado.app.model.ReadBook
import io.legado.app.service.BaseReadAloudService
import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.widget.seekbar.SeekBarChangeListener
-import io.legado.app.utils.ColorUtils
-import io.legado.app.utils.getPrefBoolean
-import io.legado.app.utils.observeEvent
-import io.legado.app.utils.toastOnUi
+import io.legado.app.utils.*
import io.legado.app.utils.viewbindingdelegate.viewBinding
@@ -67,6 +65,7 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
tvTimer.setTextColor(textColor)
ivTtsSpeechReduce.setColorFilter(textColor)
tvTtsSpeed.setTextColor(textColor)
+ tvTtsSpeedValue.setTextColor(textColor)
ivTtsSpeechAdd.setColorFilter(textColor)
ivCatalog.setColorFilter(textColor)
tvCatalog.setTextColor(textColor)
@@ -138,6 +137,12 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
//设置保存的默认值
seekTtsSpeechRate.progress = AppConfig.ttsSpeechRate
seekTtsSpeechRate.setOnSeekBarChangeListener(object : SeekBarChangeListener {
+
+ override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
+ super.onProgressChanged(seekBar, progress, fromUser)
+ upTtsSpeechRateText(progress)
+ }
+
override fun onStopTrackingTouch(seekBar: SeekBar) {
AppConfig.ttsSpeechRate = seekBar.progress
upTtsSpeechRate()
@@ -156,6 +161,8 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
private fun upTtsSpeechRateEnabled(enabled: Boolean) {
binding.run {
+ upTtsSpeechRateText(AppConfig.ttsSpeechRate)
+ tvTtsSpeedValue.visible(enabled)
seekTtsSpeechRate.isEnabled = enabled
ivTtsSpeechReduce.isEnabled = enabled
ivTtsSpeechAdd.isEnabled = enabled
@@ -194,6 +201,11 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
}
}
+ @SuppressLint("SetTextI18n")
+ private fun upTtsSpeechRateText(value: Int) {
+ binding.tvTtsSpeedValue.text = ((value + 5) / 10f).toString()
+ }
+
private fun upTtsSpeechRate() {
ReadAloud.upTtsSpeechRate(requireContext())
if (!BaseReadAloudService.pause) {
diff --git a/app/src/main/res/layout/dialog_read_aloud.xml b/app/src/main/res/layout/dialog_read_aloud.xml
index 5ac2f1962..c42e327fc 100644
--- a/app/src/main/res/layout/dialog_read_aloud.xml
+++ b/app/src/main/res/layout/dialog_read_aloud.xml
@@ -165,14 +165,28 @@
+
+
+
+
+ android:paddingBottom="7dp"
+ tools:ignore="TextSizeCheck">