Skip to content
Open
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
1 change: 1 addition & 0 deletions collect_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ dependencies {
implementation(libs.androidXComposeMaterialIcons)
implementation(libs.androidXComposePreview)
implementation(libs.coil)
implementation(libs.coil.gif)

testImplementation project(':forms-test')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ApplicationInitializer(
).initialize()
mapsInitializer.initialize()
JavaRosaInitializer(propertyManager, projectsDataService, entitiesRepositoryProvider).initialize()
CoilInitializer().initialize()
}

private fun initializeFrameworks() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.odk.collect.android.application.initialization

import android.os.Build
import coil3.ImageLoader
import coil3.SingletonImageLoader
import coil3.gif.AnimatedImageDecoder
import coil3.gif.GifDecoder

class CoilInitializer {

fun initialize() {
SingletonImageLoader.setSafe { context ->
ImageLoader.Builder(context)
.components {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
add(AnimatedImageDecoder.Factory())
} else {
add(GifDecoder.Factory())
}
}
.build()
}
}
}
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ jsoup = { group = "org.jsoup", name = "jsoup", version = "1.22.1" }
mlkit-barcodescanning = { group = "com.google.android.gms", name = "play-services-mlkit-barcode-scanning", version = "18.3.1" }
runtime-livedata = { group = "androidx.compose.runtime", name = "runtime-livedata" }
coil = { group = "io.coil-kt.coil3", name = "coil-compose", version = "3.4.0" }
coil-gif = { group = "io.coil-kt.coil3", name = "coil-gif", version = "3.4.0" }

# Test dependencies
junit = { group = "junit", name = "junit", version = "4.13.2" }
Expand Down