use long type for cache sizes
This commit is contained in:
parent
d8d8ad96e4
commit
d8a0ba23b6
4 changed files with 5 additions and 5 deletions
|
|
@ -24,7 +24,7 @@ public class CustomGlideModule extends AppGlideModule {
|
|||
@Override
|
||||
public void applyOptions(@NonNull Context context, GlideBuilder builder) {
|
||||
File cacheDir = new File(PreferenceUtil.getInstance(context).getLocationCache(), "glide");
|
||||
int size = PreferenceUtil.getInstance(context).getImageCacheSize();
|
||||
long size = PreferenceUtil.getInstance(context).getImageCacheSize();
|
||||
|
||||
builder.setDiskCache(new DiskLruCacheFactory(() -> cacheDir, size));
|
||||
builder.setDefaultRequestOptions(new RequestOptions().format(DecodeFormat.PREFER_RGB_565));
|
||||
|
|
|
|||
|
|
@ -381,11 +381,11 @@ public final class PreferenceUtil {
|
|||
return mPreferences.getString(LOCATION_CACHE, mContext.getCacheDir().toString());
|
||||
}
|
||||
|
||||
public final int getImageCacheSize() {
|
||||
public final long getImageCacheSize() {
|
||||
return Integer.parseInt(mPreferences.getString(IMAGE_CACHE_SIZE, "400000000"));
|
||||
}
|
||||
|
||||
public final int getMediaCacheSize() {
|
||||
public final long getMediaCacheSize() {
|
||||
return Integer.parseInt(mPreferences.getString(MEDIA_CACHE_SIZE, "400000000"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
</string-array>
|
||||
|
||||
<string-array name="pref_cache_size_values">
|
||||
<item>2147483647</item>
|
||||
<item>10000000000</item>
|
||||
<item>2000000000</item>
|
||||
<item>1000000000</item>
|
||||
<item>400000000</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue