parent
cfedcf0965
commit
6a5bed626a
@ -0,0 +1,22 @@
|
|||||||
|
package com.common.commonlib.image
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import com.bumptech.glide.Glide
|
||||||
|
import com.bumptech.glide.Registry
|
||||||
|
import com.bumptech.glide.annotation.GlideModule
|
||||||
|
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader
|
||||||
|
import com.bumptech.glide.load.model.GlideUrl
|
||||||
|
import com.bumptech.glide.module.LibraryGlideModule
|
||||||
|
import java.io.InputStream
|
||||||
|
|
||||||
|
@GlideModule
|
||||||
|
class OkHttpLibGlideModule : LibraryGlideModule() {
|
||||||
|
override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
|
||||||
|
registry.replace(
|
||||||
|
GlideUrl::class.java,
|
||||||
|
InputStream::class.java,
|
||||||
|
OkHttpUrlLoader.Factory()
|
||||||
|
)
|
||||||
|
super.registerComponents(context, glide, registry)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue