Skip to content

Commit

Permalink
Change emplacement where svg is used
Browse files Browse the repository at this point in the history
Change emplacement so we don't import the coil svg lib everywhere, only in mail
  • Loading branch information
NicolasBourdin88 committed May 23, 2024
1 parent 09914fd commit 9de5ef1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ dependencies {
def coilVersion = '2.6.0'
api "io.coil-kt:coil-gif:$coilVersion"
api "io.coil-kt:coil:$coilVersion"
api "io.coil-kt:coil-svg:$coilVersion"

api 'com.github.infomaniak:android-login:2.8.0'
api 'com.facebook.stetho:stetho-okhttp3:1.6.0'
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/infomaniak/lib/core/utils/CoilUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ 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.decode.SvgDecoder
import coil.disk.DiskCache
import coil.memory.MemoryCache
import com.facebook.stetho.okhttp3.StethoInterceptor
Expand Down Expand Up @@ -58,7 +58,7 @@ object CoilUtils {
context: Context,
tokenInterceptorListener: TokenInterceptorListener? = null,
gifPreview: Boolean = false,
isSvg: Boolean = false
customComponents: List<Decoder.Factory> = emptyList()
): ImageLoader {
return ImageLoader.Builder(context)
.crossfade(true)
Expand All @@ -71,7 +71,7 @@ object CoilUtils {
}
add(factory)
}
if (isSvg) add(SvgDecoder.Factory())
customComponents.forEach { add(it) }
}
.okHttpClient {
OkHttpClient.Builder().apply {
Expand Down

0 comments on commit 9de5ef1

Please sign in to comment.