diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/GlideUtils.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/GlideUtils.kt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/GlideUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/GlideUtils.kt new file mode 100644 index 00000000..6fbcced1 --- /dev/null +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/GlideUtils.kt @@ -0,0 +1,26 @@ +package com.pitchedapps.frost.utils + +import android.content.Context +import com.bumptech.glide.Glide + +/** + * Created by Allan Wang on 2017-05-31. + */ +object GlideUtils { + + lateinit var applicationContext: Context + + operator fun invoke(applicationContext: Context) { + this.applicationContext = applicationContext + } + + fun downloadForLater(url: String) { + Glide.with(applicationContext).download(url) + } + + fun downloadProfile(id: Long) { + L.d("Downloading profile photo") + downloadForLater("http://graph.facebook.com/$id/picture?type=large") + } + +}
\ No newline at end of file |