Use Coil (#4870)
* Use Coil * Remove coil-transformations lib * Add MangaCoverFetcher * Remove Glide * MangaCoverFetcher: Allow skipping custom cover usage * Adjust coil caching policy for some non-library items * Allow coil to use RGB565 only on low ram devices * Fix image loading progress view not showing a * Increase coil crossfade duration Same as default glide duration * Add back request clearing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package eu.kanade.tachiyomi.data.cache
|
||||
|
||||
import android.content.Context
|
||||
import coil.imageLoader
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.util.storage.DiskUtil
|
||||
import java.io.File
|
||||
@@ -99,6 +100,13 @@ class CoverCache(private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear coil's memory cache.
|
||||
*/
|
||||
fun clearMemoryCache() {
|
||||
context.imageLoader.memoryCache.clear()
|
||||
}
|
||||
|
||||
private fun getCacheDir(dir: String): File {
|
||||
return context.getExternalFilesDir(dir)
|
||||
?: File(context.filesDir, dir).also { it.mkdirs() }
|
||||
|
||||
Reference in New Issue
Block a user