Don't trim gallery detail cache, Resolve #710

It will only free about 1 MB memory
This commit is contained in:
FooIbar committed 2024-02-12 23:42:01 +08:00
1 parent e36520faad
commit a9dd705ec5
1 file changed
-9
@@ -17,7 +17,6 @@
package com.hippo.ehviewer
import android.app.Application
import android.content.ComponentCallbacks2
import android.content.Context
import android.os.StrictMode
import androidx.appcompat.app.AppCompatDelegate
@@ -175,14 +174,6 @@ class EhApplication : Application(), SingletonImageLoader.Factory {
}
}
override fun onTrimMemory(level: Int) {
super.onTrimMemory(level)
if (level >= ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW) {
// Keep one entry for GalleryCommentsScreen
galleryDetailCache.trimToSize(1)
}
}
override fun newImageLoader(context: Context) = context.imageLoader {
components {
serviceLoaderEnabled(false)