diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index d76027909..2598e9c94 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -135,7 +135,7 @@ object ReadBookConfig { //配置写入读取 var readBodyToLh = appCtx.getPrefBoolean(PreferKey.readBodyToLh, true) - var autoReadSpeed = appCtx.getPrefInt(PreferKey.autoReadSpeed, 46) + var autoReadSpeed = appCtx.getPrefInt(PreferKey.autoReadSpeed, 10) set(value) { field = value appCtx.putPrefInt(PreferKey.autoReadSpeed, value) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 448d0795e..65bbfc910 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -700,7 +700,9 @@ class ReadBookActivity : ReadBookBaseActivity(), var delayMillis = ReadBookConfig.autoReadSpeed * 1000L / binding.readView.height var scrollOffset = 1 if (delayMillis < 20) { - scrollOffset = 20 / delayMillis.toInt() + var delayInt=delayMillis.toInt() + if(delayInt==0)delayInt =1 + scrollOffset = 20 / delayInt delayMillis = 20 } mHandler.removeCallbacks(autoPageRunnable) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt index 9c9f774ff..bd7b835b8 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/AutoReadDialog.kt @@ -73,7 +73,7 @@ class AutoReadDialog : BaseDialogFragment() { } private fun initData() { - val speed = if (ReadBookConfig.autoReadSpeed < 10) 10 else ReadBookConfig.autoReadSpeed + val speed = if (ReadBookConfig.autoReadSpeed < 2) 2 else ReadBookConfig.autoReadSpeed binding.tvReadSpeed.text = String.format("%ds", speed) binding.seekAutoRead.progress = speed } @@ -81,13 +81,13 @@ class AutoReadDialog : BaseDialogFragment() { private fun initOnChange() { binding.seekAutoRead.setOnSeekBarChangeListener(object : SeekBarChangeListener { override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { - val speed = if (progress < 10) 10 else progress + val speed = if (progress < 2) 2 else progress binding.tvReadSpeed.text = String.format("%ds", speed) } override fun onStopTrackingTouch(seekBar: SeekBar) { ReadBookConfig.autoReadSpeed = - if (binding.seekAutoRead.progress < 10) 10 else binding.seekAutoRead.progress + if (binding.seekAutoRead.progress < 2) 2 else binding.seekAutoRead.progress upTtsSpeechRate() } }) diff --git a/app/src/main/res/layout/dialog_auto_read.xml b/app/src/main/res/layout/dialog_auto_read.xml index fb662cc73..9a2e1e196 100644 --- a/app/src/main/res/layout/dialog_auto_read.xml +++ b/app/src/main/res/layout/dialog_auto_read.xml @@ -47,8 +47,8 @@ android:layout_height="wrap_content" android:layout_marginStart="15dp" android:layout_marginEnd="15dp" - android:min="10" - android:max="100" + android:min="2" + android:max="60" tools:ignore="UnusedAttribute" />