diff --git a/app/src/main/java/io/legado/app/help/config/AppConfig.kt b/app/src/main/java/io/legado/app/help/config/AppConfig.kt index 501b8adf1..d0611bc30 100644 --- a/app/src/main/java/io/legado/app/help/config/AppConfig.kt +++ b/app/src/main/java/io/legado/app/help/config/AppConfig.kt @@ -413,9 +413,9 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener { var sourceEditMaxLine: Int get() { - val maxLine = appCtx.getPrefInt(PreferKey.sourceEditMaxLine, 99) + val maxLine = appCtx.getPrefInt(PreferKey.sourceEditMaxLine, Int.MAX_VALUE) if (maxLine < 10) { - return 99 + return Int.MAX_VALUE } return maxLine } diff --git a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt index dd611e767..72c512187 100644 --- a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt @@ -85,7 +85,7 @@ class OtherConfigFragment : PreferenceFragment(), PreferKey.preDownloadNum -> NumberPickerDialog(requireContext()) .setTitle(getString(R.string.pre_download)) .setMaxValue(9999) - .setMinValue(1) + .setMinValue(0) .setValue(AppConfig.preDownloadNum) .show { AppConfig.preDownloadNum = it @@ -123,7 +123,7 @@ class OtherConfigFragment : PreferenceFragment(), PreferKey.sourceEditMaxLine -> { NumberPickerDialog(requireContext()) .setTitle(getString(R.string.source_edit_text_max_line)) - .setMaxValue(99) + .setMaxValue(Int.MAX_VALUE) .setMinValue(10) .setValue(AppConfig.sourceEditMaxLine) .show { diff --git a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt index f1207e324..c8e60ea13 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt @@ -178,6 +178,7 @@ class MainViewModel(application: Application) : BaseViewModel(application) { @Synchronized private fun addDownload(source: BookSource, book: Book) { + if (AppConfig.preDownloadNum == 0) return val endIndex = min( book.totalChapterNum - 1, book.durChapterIndex.plus(AppConfig.preDownloadNum)