预下载章节可调整数目

pull/978/head
gedoor 4 years ago
parent 11bf63e6a6
commit ff6f4bf6ee
  1. 6
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  2. 2
      app/src/main/res/values-zh-rHK/strings.xml
  3. 2
      app/src/main/res/values-zh-rTW/strings.xml
  4. 2
      app/src/main/res/values-zh/strings.xml
  5. 2
      app/src/main/res/values/strings.xml

@ -53,6 +53,7 @@ class OtherConfigFragment : BasePreferenceFragment(),
putPrefBoolean(PreferKey.processText, isProcessTextEnabled()) putPrefBoolean(PreferKey.processText, isProcessTextEnabled())
addPreferencesFromResource(R.xml.pref_config_other) addPreferencesFromResource(R.xml.pref_config_other)
upPreferenceSummary(PreferKey.userAgent, AppConfig.userAgent) upPreferenceSummary(PreferKey.userAgent, AppConfig.userAgent)
upPreferenceSummary(PreferKey.preDownloadNum, AppConfig.preDownloadNum.toString())
upPreferenceSummary(PreferKey.threadCount, AppConfig.threadCount.toString()) upPreferenceSummary(PreferKey.threadCount, AppConfig.threadCount.toString())
upPreferenceSummary(PreferKey.webPort, webPort.toString()) upPreferenceSummary(PreferKey.webPort, webPort.toString())
upPreferenceSummary(PreferKey.defaultCover, getPrefString(PreferKey.defaultCover)) upPreferenceSummary(PreferKey.defaultCover, getPrefString(PreferKey.defaultCover))
@ -114,6 +115,9 @@ class OtherConfigFragment : BasePreferenceFragment(),
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
when (key) { when (key) {
PreferKey.preDownloadNum -> {
upPreferenceSummary(key, AppConfig.preDownloadNum.toString())
}
PreferKey.threadCount -> { PreferKey.threadCount -> {
upPreferenceSummary(key, AppConfig.threadCount.toString()) upPreferenceSummary(key, AppConfig.threadCount.toString())
postEvent(PreferKey.threadCount, "") postEvent(PreferKey.threadCount, "")
@ -149,6 +153,8 @@ class OtherConfigFragment : BasePreferenceFragment(),
private fun upPreferenceSummary(preferenceKey: String, value: String?) { private fun upPreferenceSummary(preferenceKey: String, value: String?) {
val preference = findPreference<Preference>(preferenceKey) ?: return val preference = findPreference<Preference>(preferenceKey) ?: return
when (preferenceKey) { when (preferenceKey) {
PreferKey.preDownloadNum -> preference.summary =
getString(R.string.pre_download_s, value)
PreferKey.threadCount -> preference.summary = getString(R.string.threads_num, value) PreferKey.threadCount -> preference.summary = getString(R.string.threads_num, value)
PreferKey.webPort -> preference.summary = getString(R.string.web_port_summary, value) PreferKey.webPort -> preference.summary = getString(R.string.web_port_summary, value)
else -> if (preference is ListPreference) { else -> if (preference is ListPreference) {

@ -800,7 +800,7 @@
<string name="export_bookshelf">导出书单</string> <string name="export_bookshelf">导出书单</string>
<string name="import_bookshelf">导入书单</string> <string name="import_bookshelf">导入书单</string>
<string name="pre_download">预下载</string> <string name="pre_download">预下载</string>
<string name="pre_download_s">预先下载%d章正文</string> <string name="pre_download_s">预先下载%s章正文</string>
<string name="sort_enable">启用排序</string> <string name="sort_enable">启用排序</string>
<string name="background_image">背景图片</string> <string name="background_image">背景图片</string>
<string name="export_folder">导出文件夹</string> <string name="export_folder">导出文件夹</string>

@ -804,7 +804,7 @@
<string name="export_bookshelf">匯出書單</string> <string name="export_bookshelf">匯出書單</string>
<string name="import_bookshelf">匯入書單</string> <string name="import_bookshelf">匯入書單</string>
<string name="pre_download">預下載</string> <string name="pre_download">預下載</string>
<string name="pre_download_s">預先下載%d章正文</string> <string name="pre_download_s">預先下載%s章正文</string>
<string name="sort_enable">啟用排序</string> <string name="sort_enable">啟用排序</string>
<string name="background_image">背景圖片</string> <string name="background_image">背景圖片</string>
<string name="export_folder">匯出資料夾</string> <string name="export_folder">匯出資料夾</string>

@ -804,7 +804,7 @@
<string name="export_bookshelf">导出书单</string> <string name="export_bookshelf">导出书单</string>
<string name="import_bookshelf">导入书单</string> <string name="import_bookshelf">导入书单</string>
<string name="pre_download">预下载</string> <string name="pre_download">预下载</string>
<string name="pre_download_s">预先下载%d章正文</string> <string name="pre_download_s">预先下载%s章正文</string>
<string name="sort_enable">启用排序</string> <string name="sort_enable">启用排序</string>
<string name="background_image">背景图片</string> <string name="background_image">背景图片</string>
<string name="export_folder">导出文件夹</string> <string name="export_folder">导出文件夹</string>

@ -805,7 +805,7 @@
<string name="export_bookshelf">导出书单</string> <string name="export_bookshelf">导出书单</string>
<string name="import_bookshelf">导入书单</string> <string name="import_bookshelf">导入书单</string>
<string name="pre_download">预下载</string> <string name="pre_download">预下载</string>
<string name="pre_download_s">预先下载%d章正文</string> <string name="pre_download_s">预先下载%s章正文</string>
<string name="sort_enable">启用排序</string> <string name="sort_enable">启用排序</string>
<string name="background_image">背景图片</string> <string name="background_image">背景图片</string>
<string name="export_folder">导出文件夹</string> <string name="export_folder">导出文件夹</string>

Loading…
Cancel
Save