feat(ImageProvider): add bitmapLrucache size setting

pull/1921/head
Xwite 2 years ago
parent 83bc051f79
commit eda8567f6a
  1. 7
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  2. 2
      app/src/main/res/values-es-rES/strings.xml
  3. 2
      app/src/main/res/values-ja-rJP/strings.xml
  4. 2
      app/src/main/res/values-pt-rBR/strings.xml
  5. 1
      app/src/main/res/values-zh-rHK/strings.xml
  6. 1
      app/src/main/res/values-zh-rTW/strings.xml
  7. 1
      app/src/main/res/values-zh/strings.xml
  8. 2
      app/src/main/res/values/strings.xml

@ -105,7 +105,9 @@ class OtherConfigFragment : PreferenceFragment(),
PreferKey.cleanCache -> clearCache() PreferKey.cleanCache -> clearCache()
PreferKey.uploadRule -> showDialogFragment<DirectLinkUploadConfig>() PreferKey.uploadRule -> showDialogFragment<DirectLinkUploadConfig>()
PreferKey.checkSource -> showDialogFragment<CheckSourceConfig>() PreferKey.checkSource -> showDialogFragment<CheckSourceConfig>()
PreferKey.bitmapCacheSize -> NumberPickerDialog(requireContext()) PreferKey.bitmapCacheSize -> {
toastOnUi(R.string.restart_to_apply_changes)
NumberPickerDialog(requireContext())
.setTitle(getString(R.string.bitmap_cache_size)) .setTitle(getString(R.string.bitmap_cache_size))
.setMaxValue(9999) .setMaxValue(9999)
.setMinValue(1) .setMinValue(1)
@ -114,6 +116,7 @@ class OtherConfigFragment : PreferenceFragment(),
AppConfig.bitmapCacheSize = it AppConfig.bitmapCacheSize = it
} }
} }
}
return super.onPreferenceTreeClick(preference) return super.onPreferenceTreeClick(preference)
} }
@ -152,8 +155,6 @@ class OtherConfigFragment : PreferenceFragment(),
} }
PreferKey.bitmapCacheSize -> { PreferKey.bitmapCacheSize -> {
upPreferenceSummary(key, AppConfig.bitmapCacheSize.toString()) upPreferenceSummary(key, AppConfig.bitmapCacheSize.toString())
// restart to apply changes
appCtx.restart()
} }
} }
} }

@ -990,5 +990,7 @@
<string name="add_remote_book">WebDavBook</string> <string name="add_remote_book">WebDavBook</string>
<string name="bitmap_cache_size_summary">Current cache max size %1$s MB</string> <string name="bitmap_cache_size_summary">Current cache max size %1$s MB</string>
<string name="bitmap_cache_size">bitmap cache size</string> <string name="bitmap_cache_size">bitmap cache size</string>
<string name="restart_to_apply_changes">Restart to apply changes</string>
<!-- string end --> <!-- string end -->
</resources> </resources>

@ -993,5 +993,7 @@
<string name="add_remote_book">WebDavBook</string> <string name="add_remote_book">WebDavBook</string>
<string name="bitmap_cache_size_summary">Current cache max size %1$s MB</string> <string name="bitmap_cache_size_summary">Current cache max size %1$s MB</string>
<string name="bitmap_cache_size">bitmap cache size</string> <string name="bitmap_cache_size">bitmap cache size</string>
<string name="restart_to_apply_changes">Restart to apply changes</string>
<!-- string end --> <!-- string end -->
</resources> </resources>

@ -993,5 +993,7 @@
<string name="add_remote_book">WebDavBook</string> <string name="add_remote_book">WebDavBook</string>
<string name="bitmap_cache_size_summary">Current cache max size %1$s MB</string> <string name="bitmap_cache_size_summary">Current cache max size %1$s MB</string>
<string name="bitmap_cache_size">bitmap cache size</string> <string name="bitmap_cache_size">bitmap cache size</string>
<string name="restart_to_apply_changes">Restart to apply changes</string>
<!-- string end --> <!-- string end -->
</resources> </resources>

@ -990,6 +990,7 @@
<string name="add_remote_book">WebDav书籍</string> <string name="add_remote_book">WebDav书籍</string>
<string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string> <string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string>
<string name="bitmap_cache_size">图片绘制缓存</string> <string name="bitmap_cache_size">图片绘制缓存</string>
<string name="restart_to_apply_changes">重启应用更改</string>
<!-- string end --> <!-- string end -->
</resources> </resources>

@ -992,6 +992,7 @@
<string name="add_remote_book">WebDav书籍</string> <string name="add_remote_book">WebDav书籍</string>
<string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string> <string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string>
<string name="bitmap_cache_size">图片绘制缓存</string> <string name="bitmap_cache_size">图片绘制缓存</string>
<string name="restart_to_apply_changes">重启应用更改</string>
<!-- string end --> <!-- string end -->
</resources> </resources>

@ -992,6 +992,7 @@
<string name="add_remote_book">WebDav书籍</string> <string name="add_remote_book">WebDav书籍</string>
<string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string> <string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string>
<string name="bitmap_cache_size">图片绘制缓存</string> <string name="bitmap_cache_size">图片绘制缓存</string>
<string name="restart_to_apply_changes">重启应用更改</string>
<!-- string end --> <!-- string end -->
</resources> </resources>

@ -993,5 +993,7 @@
<string name="add_remote_book">WebDavBook</string> <string name="add_remote_book">WebDavBook</string>
<string name="bitmap_cache_size_summary">Current cache max size %1$s MB</string> <string name="bitmap_cache_size_summary">Current cache max size %1$s MB</string>
<string name="bitmap_cache_size">bitmap cache size</string> <string name="bitmap_cache_size">bitmap cache size</string>
<string name="restart_to_apply_changes">Restart to apply changes</string>
<!-- string end --> <!-- string end -->
</resources> </resources>

Loading…
Cancel
Save