mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 22:29:09 +00:00
Update to coil 2.x API
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
865be74f07
commit
602c197dae
@ -46,6 +46,7 @@ import coil.ImageLoader
|
||||
import coil.decode.GifDecoder
|
||||
import coil.decode.ImageDecoderDecoder
|
||||
import coil.decode.SvgDecoder
|
||||
import coil.memory.MemoryCache
|
||||
import com.facebook.cache.disk.DiskCacheConfig
|
||||
import com.facebook.drawee.backends.pipeline.Fresco
|
||||
import com.facebook.imagepipeline.core.ImagePipelineConfig
|
||||
@ -220,15 +221,18 @@ class NextcloudTalkApplication : MultiDexApplication(), LifecycleObserver {
|
||||
|
||||
private fun buildDefaultImageLoader(): ImageLoader {
|
||||
return ImageLoader.Builder(applicationContext)
|
||||
.availableMemoryPercentage(FIFTY_PERCENT) // Use 50% of the application's available memory.
|
||||
.memoryCache {
|
||||
// Use 50% of the application's available memory.
|
||||
MemoryCache.Builder(applicationContext).maxSizePercent(FIFTY_PERCENT).build()
|
||||
}
|
||||
.crossfade(true) // Show a short crossfade when loading images from network or disk into an ImageView.
|
||||
.componentRegistry {
|
||||
.components {
|
||||
if (SDK_INT >= P) {
|
||||
add(ImageDecoderDecoder(applicationContext))
|
||||
add(ImageDecoderDecoder.Factory())
|
||||
} else {
|
||||
add(GifDecoder())
|
||||
add(GifDecoder.Factory())
|
||||
}
|
||||
add(SvgDecoder(applicationContext))
|
||||
add(SvgDecoder.Factory())
|
||||
}
|
||||
.okHttpClient(okHttpClient)
|
||||
.build()
|
||||
|
Loading…
Reference in New Issue
Block a user