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

Remove gif preview to use it only in the good project #197

Merged
merged 3 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading