This commit is contained in:
Horis
2026-03-10 21:48:08 +08:00
parent 24687a4403
commit 404923cf58
2 changed files with 2 additions and 2 deletions
@@ -41,7 +41,7 @@ object ImageProvider {
private const val M = 1024 * 1024 private const val M = 1024 * 1024
val cacheSize: Int val cacheSize: Int
get() { get() {
if (AppConfig.bitmapCacheSize <= 0 || AppConfig.bitmapCacheSize >= 2048) { if (AppConfig.bitmapCacheSize !in 1..1024) {
AppConfig.bitmapCacheSize = 50 AppConfig.bitmapCacheSize = 50
} }
return AppConfig.bitmapCacheSize * M return AppConfig.bitmapCacheSize * M
@@ -126,7 +126,7 @@ class OtherConfigFragment : PreferenceFragment(),
PreferKey.bitmapCacheSize -> { PreferKey.bitmapCacheSize -> {
NumberPickerDialog(requireContext()) NumberPickerDialog(requireContext())
.setTitle(getString(R.string.bitmap_cache_size)) .setTitle(getString(R.string.bitmap_cache_size))
.setMaxValue(2047) .setMaxValue(1024)
.setMinValue(1) .setMinValue(1)
.setValue(AppConfig.bitmapCacheSize) .setValue(AppConfig.bitmapCacheSize)
.show { .show {