how to use GlideModule on Glide 4?
Glide 4.0 need not have declare "GlideModule" in AndroidManifest.xml. You just need to following steps:
- YourGlideModule extends AppGlideModule, you can override function
applyOptions
in the YourGlideModule class. - You should make project in "android studio -> build -> make project", it will generate the
GlideApp
class. - Use the GlideApp such as
GlideApp.with(this).load(imgUrl).into(glide_test_iv1)
Adding in @kevin & @brady lee answers. For Kotlin Users
implementation ('com.github.bumptech.glide:okhttp3-integration:4.4.0'){
exclude group: 'glide-parent'
}
kapt 'com.github.bumptech.glide:compiler:4.10.0'
If GlideApp
can't be generated then -
Make sure you have build.gradle
dependency of annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
Make sure your UnsafeOkHttpGlideModule
extends AppGlideModule
and also in meta-data
the android:value=""
should be android:value="AppGlideModule"