优化
This commit is contained in:
@@ -12,6 +12,7 @@ import io.legado.app.base.BaseDialogFragment
|
|||||||
import io.legado.app.constant.EventBus
|
import io.legado.app.constant.EventBus
|
||||||
import io.legado.app.databinding.DialogReadAloudBinding
|
import io.legado.app.databinding.DialogReadAloudBinding
|
||||||
import io.legado.app.help.config.AppConfig
|
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.bottomBackground
|
||||||
import io.legado.app.lib.theme.getPrimaryTextColor
|
import io.legado.app.lib.theme.getPrimaryTextColor
|
||||||
import io.legado.app.model.ReadAloud
|
import io.legado.app.model.ReadAloud
|
||||||
@@ -127,6 +128,13 @@ class ReadAloudDialog : BaseDialogFragment(R.layout.dialog_read_aloud) {
|
|||||||
AppConfig.ttsTimer = seekTimer.progress
|
AppConfig.ttsTimer = seekTimer.progress
|
||||||
toastOnUi("保存设定时间成功!")
|
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.progress = AppConfig.ttsSpeechRate
|
||||||
seekTtsSpeechRate.setOnSeekBarChangeListener(object : SeekBarChangeListener {
|
seekTtsSpeechRate.setOnSeekBarChangeListener(object : SeekBarChangeListener {
|
||||||
|
|||||||
@@ -144,6 +144,7 @@
|
|||||||
android:id="@+id/tv_timer"
|
android:id="@+id/tv_timer"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||||
android:textColor="@color/primaryText"
|
android:textColor="@color/primaryText"
|
||||||
android:text="@string/timer_m" />
|
android:text="@string/timer_m" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user