feat(ImageProvider): add bitmapLrucache size setting

This commit is contained in:
Xwite
2022-05-29 14:57:55 +08:00
parent 83bc051f79
commit eda8567f6a
8 changed files with 22 additions and 10 deletions
@@ -105,14 +105,17 @@ class OtherConfigFragment : PreferenceFragment(),
PreferKey.cleanCache -> clearCache()
PreferKey.uploadRule -> showDialogFragment<DirectLinkUploadConfig>()
PreferKey.checkSource -> showDialogFragment<CheckSourceConfig>()
PreferKey.bitmapCacheSize -> NumberPickerDialog(requireContext())
.setTitle(getString(R.string.bitmap_cache_size))
.setMaxValue(9999)
.setMinValue(1)
.setValue(AppConfig.bitmapCacheSize)
.show {
AppConfig.bitmapCacheSize = it
}
PreferKey.bitmapCacheSize -> {
toastOnUi(R.string.restart_to_apply_changes)
NumberPickerDialog(requireContext())
.setTitle(getString(R.string.bitmap_cache_size))
.setMaxValue(9999)
.setMinValue(1)
.setValue(AppConfig.bitmapCacheSize)
.show {
AppConfig.bitmapCacheSize = it
}
}
}
return super.onPreferenceTreeClick(preference)
}
@@ -152,8 +155,6 @@ class OtherConfigFragment : PreferenceFragment(),
}
PreferKey.bitmapCacheSize -> {
upPreferenceSummary(key, AppConfig.bitmapCacheSize.toString())
// restart to apply changes
appCtx.restart()
}
}
}
@@ -990,5 +990,7 @@
<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">bitmap cache size</string>
<string name="restart_to_apply_changes">Restart to apply changes</string>
<!-- string end -->
</resources>
@@ -993,5 +993,7 @@
<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">bitmap cache size</string>
<string name="restart_to_apply_changes">Restart to apply changes</string>
<!-- string end -->
</resources>
@@ -993,5 +993,7 @@
<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">bitmap cache size</string>
<string name="restart_to_apply_changes">Restart to apply changes</string>
<!-- string end -->
</resources>
@@ -990,6 +990,7 @@
<string name="add_remote_book">WebDav书籍</string>
<string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string>
<string name="bitmap_cache_size">图片绘制缓存</string>
<string name="restart_to_apply_changes">重启应用更改</string>
<!-- string end -->
</resources>
@@ -992,6 +992,7 @@
<string name="add_remote_book">WebDav书籍</string>
<string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string>
<string name="bitmap_cache_size">图片绘制缓存</string>
<string name="restart_to_apply_changes">重启应用更改</string>
<!-- string end -->
</resources>
+1
View File
@@ -992,6 +992,7 @@
<string name="add_remote_book">WebDav书籍</string>
<string name="bitmap_cache_size_summary">当前最大缓存 %1$s MB</string>
<string name="bitmap_cache_size">图片绘制缓存</string>
<string name="restart_to_apply_changes">重启应用更改</string>
<!-- string end -->
</resources>
+2
View File
@@ -993,5 +993,7 @@
<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">bitmap cache size</string>
<string name="restart_to_apply_changes">Restart to apply changes</string>
<!-- string end -->
</resources>