From 232afd0c8198d7acd7cda202926b1cd37ccd0a40 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Tue, 25 Oct 2022 23:08:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 4 ++++ .../main/java/io/legado/app/service/BaseReadAloudService.kt | 3 +++ .../io/legado/app/ui/book/read/config/ReadAloudDialog.kt | 6 +++++- app/src/main/res/layout/dialog_read_aloud.xml | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index c4fc860b8..43c17a9a0 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -11,6 +11,10 @@ * 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则或简繁转换出现问题。 * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! +**2022/10/25** + +* 朗读菜单的闹钟点击后可以保存设定时间,下次启动朗读自动设定时间,调不了时间的把进度条拉到0然后点一下闹钟就可以了 by Horis + **2022/10/22** * 搜索范围保持分组排序 diff --git a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt index 10ec73a7b..7cba4dd70 100644 --- a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt @@ -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() { 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 691e3d72b..41554df80 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 @@ -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) } }) diff --git a/app/src/main/res/layout/dialog_read_aloud.xml b/app/src/main/res/layout/dialog_read_aloud.xml index f93ebc4f6..2a9467d36 100644 --- a/app/src/main/res/layout/dialog_read_aloud.xml +++ b/app/src/main/res/layout/dialog_read_aloud.xml @@ -126,6 +126,7 @@ android:id="@+id/iv_timer" android:layout_width="30dp" android:layout_height="30dp" + android:background="?android:attr/selectableItemBackgroundBorderless" android:tooltipText="@string/set_timer" android:contentDescription="@string/set_timer" android:src="@drawable/ic_time_add_24dp"