Skip to content

Instantly share code, notes, and snippets.

View KirkBushman's full-sized avatar
🎯
Focusing

Luca Pellizzari KirkBushman

🎯
Focusing
View GitHub Profile
@KirkBushman
KirkBushman / GlideLoader.kt
Created April 5, 2018 19:56
Progress loader on Gifs
class GlideLoader(private val imageView: ImageView, private val progressBar: ProgressBar) {
fun load(url: String, options: RequestOptions) {
onConnecting()
ProgressAppGlideModule.expect(url, object : ProgressAppGlideModule.UIonProgressListener {
override fun onProgress(bytesRead: Long, expectedLength: Long) {
progressBar.setProgress((100 * bytesRead / expectedLength).toInt())
}