CoverGlideModule.kt 682 B

12345678910111213141516171819202122
  1. package eu.kanade.tachiyomi.data.cache
  2. import android.content.Context
  3. import com.bumptech.glide.Glide
  4. import com.bumptech.glide.GlideBuilder
  5. import com.bumptech.glide.load.engine.cache.InternalCacheDiskCacheFactory
  6. import com.bumptech.glide.module.GlideModule
  7. /**
  8. * Class used to update Glide module settings
  9. */
  10. class CoverGlideModule : GlideModule {
  11. override fun applyOptions(context: Context, builder: GlideBuilder) {
  12. // Set the cache size of Glide to 15 MiB
  13. builder.setDiskCache(InternalCacheDiskCacheFactory(context, 15 * 1024 * 1024))
  14. }
  15. override fun registerComponents(context: Context, glide: Glide) {
  16. // Nothing to see here!
  17. }
  18. }