Glide for Android
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
// For android compat version
implementation 'com.github.zeropercenthappy:GlideUtil:1.0.4'
// For androidX version
implementation 'com.github.zeropercenthappy:GlideUtil:1.1.0'
}
loadImage {
// required
imageView = ...
url = ...
// options
requestOptions = ...
transitionOptions = ...
thumbnail = ...
errorBuilder = ...
requestListener = ...
}
or
loadImageWithBitmap {
// required
imageView = ...
url = ...
// options
requestOptions = ...
transitionOptions = ...
thumbnail = ...
errorBuilder = ...
requestListener = ...
}
// it's a suspend function, should be called only from a coroutine or another suspend function.
val result = context.downloadImage {
// required
url = ...
storageFile = ...
// options
requestListener = ...
}