author:wangyimiao

desc:添加glide依赖
master
yimiao 3 years ago
parent cfedcf0965
commit 6a5bed626a

@ -69,4 +69,11 @@ dependencies {
//luban
implementation rootProject.ext.dependencies.luban
// glide
implementation rootProject.ext.dependencies.glide
// glideOkHttp3
implementation rootProject.ext.dependencies.gilde_integration
// glide
kapt rootProject.ext.dependencies.annotationProcessor
}

@ -129,3 +129,7 @@
public<fields>;
public<methods>;
}
# 保留glide的配置类
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep class com.bumptech.glide.GeneratedAppGlideModuleImpl

@ -3,4 +3,6 @@
package="com.common.commonlib">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>

@ -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)
}
}

@ -33,7 +33,7 @@ ext {
jxl : "2.6.12",
navigation_fragment_ktx: "2.3.0",
navigation_ui_ktx : "2.3.0",
glide : "4.11.0",
glide : "4.12.0",
photo_view : "2.3.0",
luban : "1.1.8",
kotlin_android : "1.4.1"
@ -57,6 +57,7 @@ ext {
navigation_ui_ktx : "androidx.navigation:navigation-ui-ktx:${versions.navigation_ui_ktx}",
navigation_arg : "androidx.navigation:navigation-safe-args-gradle-plugin:${versions.navigation_ui_ktx}",
glide : "com.github.bumptech.glide:glide:${versions.glide}",
gilde_integration : "com.github.bumptech.glide:okhttp3-integration:${versions.glide}",
annotationProcessor : "com.github.bumptech.glide:compiler:${versions.glide}",
photo_view : "com.github.chrisbanes:PhotoView:${versions.photo_view}",
luban : "top.zibin:Luban:${versions.luban}"

Loading…
Cancel
Save