Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to add custom components on image loader builder #179

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/com/infomaniak/lib/core/utils/CoilUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package com.infomaniak.lib.core.utils
import android.content.Context
import android.os.Build
import coil.ImageLoader
import coil.decode.Decoder
import coil.decode.GifDecoder
import coil.decode.ImageDecoderDecoder
import coil.disk.DiskCache
Expand Down Expand Up @@ -54,6 +55,7 @@ object CoilUtils {
context: Context,
tokenInterceptorListener: TokenInterceptorListener? = null,
gifPreview: Boolean = false,
customComponents: List<Decoder.Factory> = emptyList()
NicolasBourdin88 marked this conversation as resolved.
Show resolved Hide resolved
): ImageLoader {
return ImageLoader.Builder(context)
.crossfade(true)
Expand All @@ -66,6 +68,7 @@ object CoilUtils {
}
add(factory)
}
customComponents.forEach { add(it) }
}
.okHttpClient {
OkHttpClient.Builder().apply {
Expand Down
Loading