mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-09 07:29:52 +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.GifDecoder
|
||||||
import coil.decode.ImageDecoderDecoder
|
import coil.decode.ImageDecoderDecoder
|
||||||
import coil.decode.SvgDecoder
|
import coil.decode.SvgDecoder
|
||||||
|
import coil.memory.MemoryCache
|
||||||
import com.facebook.cache.disk.DiskCacheConfig
|
import com.facebook.cache.disk.DiskCacheConfig
|
||||||
import com.facebook.drawee.backends.pipeline.Fresco
|
import com.facebook.drawee.backends.pipeline.Fresco
|
||||||
import com.facebook.imagepipeline.core.ImagePipelineConfig
|
import com.facebook.imagepipeline.core.ImagePipelineConfig
|
||||||
@ -220,15 +221,18 @@ class NextcloudTalkApplication : MultiDexApplication(), LifecycleObserver {
|
|||||||
|
|
||||||
private fun buildDefaultImageLoader(): ImageLoader {
|
private fun buildDefaultImageLoader(): ImageLoader {
|
||||||
return ImageLoader.Builder(applicationContext)
|
return ImageLoader.Builder(applicationContext)
|
||||||
.availableMemoryPercentage(FIFTY_PERCENT) // Use 50% of the application's available memory.
|
.memoryCache {
|
||||||
.crossfade(true) // Show a short crossfade when loading images from network or disk into an ImageView.
|
// Use 50% of the application's available memory.
|
||||||
.componentRegistry {
|
MemoryCache.Builder(applicationContext).maxSizePercent(FIFTY_PERCENT).build()
|
||||||
if (SDK_INT >= P) {
|
|
||||||
add(ImageDecoderDecoder(applicationContext))
|
|
||||||
} else {
|
|
||||||
add(GifDecoder())
|
|
||||||
}
|
}
|
||||||
add(SvgDecoder(applicationContext))
|
.crossfade(true) // Show a short crossfade when loading images from network or disk into an ImageView.
|
||||||
|
.components {
|
||||||
|
if (SDK_INT >= P) {
|
||||||
|
add(ImageDecoderDecoder.Factory())
|
||||||
|
} else {
|
||||||
|
add(GifDecoder.Factory())
|
||||||
|
}
|
||||||
|
add(SvgDecoder.Factory())
|
||||||
}
|
}
|
||||||
.okHttpClient(okHttpClient)
|
.okHttpClient(okHttpClient)
|
||||||
.build()
|
.build()
|
||||||
|
Loading…
Reference in New Issue
Block a user