优化
This commit is contained in:
@@ -86,6 +86,9 @@ abstract class BaseReadAloudService : BaseService(),
|
||||
upNotification()
|
||||
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PLAYING)
|
||||
setTimer(AppConfig.ttsTimer)
|
||||
if (AppConfig.ttsTimer > 0) {
|
||||
toastOnUi("朗读定时 ${AppConfig.ttsTimer} 分钟")
|
||||
}
|
||||
}
|
||||
|
||||
fun observeLiveBus() {
|
||||
|
||||
@@ -22,6 +22,7 @@ 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.viewbindingdelegate.viewBinding
|
||||
|
||||
|
||||
@@ -122,6 +123,10 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
|
||||
AppConfig.ttsSpeechRate = AppConfig.ttsSpeechRate + 1
|
||||
upTtsSpeechRate()
|
||||
}
|
||||
ivTimer.setOnClickListener {
|
||||
AppConfig.ttsTimer = seekTimer.progress
|
||||
toastOnUi("保存设定时间成功!")
|
||||
}
|
||||
//设置保存的默认值
|
||||
seekTtsSpeechRate.progress = AppConfig.ttsSpeechRate
|
||||
seekTtsSpeechRate.setOnSeekBarChangeListener(object : SeekBarChangeListener {
|
||||
@@ -136,7 +141,6 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
|
||||
}
|
||||
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar) {
|
||||
AppConfig.ttsTimer = seekTimer.progress
|
||||
ReadAloud.setTimer(requireContext(), seekTimer.progress)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user