pull/1861/head
kunfei 3 years ago
parent 3b98f948f2
commit 237a8e9883
  1. 12
      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)

Loading…
Cancel
Save