pull/2498/head
Horis 2 years ago
parent 0619fd0680
commit 3df4a2dcc4
  1. 8
      app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt
  2. 1
      app/src/main/res/layout/dialog_read_aloud.xml

@ -12,6 +12,7 @@ import io.legado.app.base.BaseDialogFragment
import io.legado.app.constant.EventBus
import io.legado.app.databinding.DialogReadAloudBinding
import io.legado.app.help.config.AppConfig
import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.theme.bottomBackground
import io.legado.app.lib.theme.getPrimaryTextColor
import io.legado.app.model.ReadAloud
@ -127,6 +128,13 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
AppConfig.ttsTimer = seekTimer.progress
toastOnUi("保存设定时间成功!")
}
tvTimer.setOnClickListener {
val times = arrayOf(0, 5, 10, 15, 30, 60, 90, 180)
val timeKeys = times.map { "$it 分钟" }
context?.selector("设定时间", timeKeys) { _, index ->
ReadAloud.setTimer(requireContext(), times[index])
}
}
//设置保存的默认值
seekTtsSpeechRate.progress = AppConfig.ttsSpeechRate
seekTtsSpeechRate.setOnSeekBarChangeListener(object : SeekBarChangeListener {

@ -144,6 +144,7 @@
android:id="@+id/tv_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:textColor="@color/primaryText"
android:text="@string/timer_m" />

Loading…
Cancel
Save