Чат, правки

This commit is contained in:
Халимов Рустам
2026-04-14 12:52:03 +03:00
parent d7e75797ef
commit 2d0bc0d75c
12 changed files with 89 additions and 34 deletions

View File

@@ -0,0 +1,26 @@
package core.utils
import android.content.Context
import android.os.Build
import coil.ImageLoader
import coil.decode.GifDecoder
import coil.decode.ImageDecoderDecoder
object CoilUtils {
private var gifImageLoader: ImageLoader? = null
fun getGifImageLoader(context: Context): ImageLoader {
if (gifImageLoader == null) {
gifImageLoader = ImageLoader.Builder(context)
.components {
if (Build.VERSION.SDK_INT >= 28) {
add(ImageDecoderDecoder.Factory())
} else {
add(GifDecoder.Factory())
}
}
.build()
}
return gifImageLoader!!
}
}