mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Try using custom fetcher for Coil...
This commit is contained in:
@@ -95,6 +95,7 @@ dependencies {
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
|
||||
implementation 'androidx.activity:activity-compose:1.6.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1'
|
||||
implementation 'io.coil-kt:coil:2.2.1'
|
||||
implementation 'com.jakewharton.timber:timber:5.0.1'
|
||||
debugImplementation "androidx.compose.ui:ui-tooling"
|
||||
debugImplementation "androidx.compose.ui:ui-test-manifest"
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package io.element.android.x
|
||||
|
||||
import android.app.Application
|
||||
import coil.ImageLoader
|
||||
import coil.ImageLoaderFactory
|
||||
import com.airbnb.mvrx.Mavericks
|
||||
import io.element.android.x.matrix.MatrixInstance
|
||||
import io.element.android.x.matrix.media.MediaFetcher
|
||||
import kotlinx.coroutines.CoroutineName
|
||||
import kotlinx.coroutines.MainScope
|
||||
import kotlinx.coroutines.plus
|
||||
import timber.log.Timber
|
||||
|
||||
class ElementXApplication : Application() {
|
||||
class ElementXApplication : Application(), ImageLoaderFactory {
|
||||
|
||||
private val applicationScope = MainScope() + CoroutineName("ElementX Scope")
|
||||
|
||||
@@ -18,4 +21,13 @@ class ElementXApplication : Application() {
|
||||
MatrixInstance.init(this, applicationScope)
|
||||
Mavericks.initialize(this)
|
||||
}
|
||||
|
||||
override fun newImageLoader(): ImageLoader {
|
||||
return ImageLoader
|
||||
.Builder(this)
|
||||
.components {
|
||||
add(MediaFetcher.Factory(MatrixInstance.getInstance()))
|
||||
}
|
||||
.build()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user