Skip to content

Commit

Permalink
Merge pull request #197 from Infomaniak/remove-gif-preview
Browse files Browse the repository at this point in the history
Remove gif preview to use it only in the good project
  • Loading branch information
NicolasBourdin88 authored Jun 19, 2024
2 parents c80a9ee + 068f52f commit f5716f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ dependencies {
api 'com.google.android.material:material:1.12.0'
api 'com.google.code.gson:gson:2.11.0'

def coilVersion = '2.6.0'
api "io.coil-kt:coil-gif:$coilVersion"
api "io.coil-kt:coil:$coilVersion"
api "io.coil-kt:coil:2.6.0"

api 'com.github.infomaniak:android-login:2.8.0'
api 'com.facebook.stetho:stetho-okhttp3:1.6.0'
Expand Down
14 changes: 1 addition & 13 deletions src/main/java/com/infomaniak/lib/core/utils/CoilUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
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
import coil.memory.MemoryCache
import com.infomaniak.lib.core.auth.TokenAuthenticator
Expand Down Expand Up @@ -54,21 +51,12 @@ object CoilUtils {
fun newImageLoader(
context: Context,
tokenInterceptorListener: TokenInterceptorListener? = null,
gifPreview: Boolean = false,
customFactories: List<Decoder.Factory> = emptyList()
): ImageLoader {
return ImageLoader.Builder(context)
.crossfade(true)
.components {
if (gifPreview) {
val factory = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
ImageDecoderDecoder.Factory()
} else {
GifDecoder.Factory()
}
add(factory)
}
customFactories.forEach { add(it) }
customFactories.forEach(::add)
}
.okHttpClient {
OkHttpClient.Builder().apply {
Expand Down

0 comments on commit f5716f7

Please sign in to comment.