mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
自动翻页速度下限调整为1秒 (#4588)
Some checks are pending
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
Some checks are pending
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
This commit is contained in:
@@ -22,6 +22,7 @@ import io.legado.app.ui.book.read.ReadBookActivity
|
||||
import io.legado.app.ui.widget.seekbar.SeekBarChangeListener
|
||||
import io.legado.app.utils.ColorUtils
|
||||
import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
import java.util.Locale
|
||||
|
||||
|
||||
class AutoReadDialog : BaseDialogFragment(R.layout.dialog_auto_read) {
|
||||
@@ -74,21 +75,21 @@ class AutoReadDialog : BaseDialogFragment(R.layout.dialog_auto_read) {
|
||||
}
|
||||
|
||||
private fun initData() {
|
||||
val speed = if (ReadBookConfig.autoReadSpeed < 2) 2 else ReadBookConfig.autoReadSpeed
|
||||
binding.tvReadSpeed.text = String.format("%ds", speed)
|
||||
val speed = if (ReadBookConfig.autoReadSpeed < 1) 1 else ReadBookConfig.autoReadSpeed
|
||||
binding.tvReadSpeed.text = String.format(Locale.ROOT, "%ds", speed)
|
||||
binding.seekAutoRead.progress = speed
|
||||
}
|
||||
|
||||
private fun initOnChange() {
|
||||
binding.seekAutoRead.setOnSeekBarChangeListener(object : SeekBarChangeListener {
|
||||
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
|
||||
val speed = if (progress < 2) 2 else progress
|
||||
binding.tvReadSpeed.text = String.format("%ds", speed)
|
||||
val speed = if (progress < 1) 1 else progress
|
||||
binding.tvReadSpeed.text = String.format(Locale.ROOT,"%ds", speed)
|
||||
}
|
||||
|
||||
override fun onStopTrackingTouch(seekBar: SeekBar) {
|
||||
ReadBookConfig.autoReadSpeed =
|
||||
if (binding.seekAutoRead.progress < 2) 2 else binding.seekAutoRead.progress
|
||||
if (binding.seekAutoRead.progress < 1) 1 else binding.seekAutoRead.progress
|
||||
upTtsSpeechRate()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:min="2"
|
||||
android:min="1"
|
||||
android:max="60"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user